diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-10-29 01:42:18 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-10-29 01:42:18 (GMT) |
commit | 71f78ed1de764f208d95b703744c7682d448c3e3 (patch) | |
tree | 8e72d3dd4068fc22320de66ab7145fa75119f54c /doc/exec.n | |
parent | ccacc920f9cd610a9a9d8e800f623c20bf43a702 (diff) | |
download | tcl-71f78ed1de764f208d95b703744c7682d448c3e3.zip tcl-71f78ed1de764f208d95b703744c7682d448c3e3.tar.gz tcl-71f78ed1de764f208d95b703744c7682d448c3e3.tar.bz2 |
Next stage of doing GOOBE improvements to documentation now that the html generation works
Diffstat (limited to 'doc/exec.n')
-rw-r--r-- | doc/exec.n | 66 |
1 files changed, 44 insertions, 22 deletions
@@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: exec.n,v 1.19 2007/10/26 20:11:52 dgp Exp $ +'\" RCS: @(#) $Id: exec.n,v 1.20 2007/10/29 01:42:18 dkf Exp $ '\" .so man.macros .TH exec n 8.5 Tcl "Tcl Built-In Commands" @@ -49,9 +49,12 @@ If an \fIarg\fR (or pair of \fIarg\fRs) has one of the forms described below then it is used by \fBexec\fR to control the flow of input and output among the subprocess(es). Such arguments will not be passed to the subprocess(es). In forms -such as ``< \fIfileName\fR'' \fIfileName\fR may either be in a -separate argument from ``<'' or in the same argument with no -intervening space (i.e. ``<\fIfileName\fR''). +such as +.QW "\fB<\fR \fIfileName\fR" , +\fIfileName\fR may either be in a separate argument from +.QW \fB<\fR +or in the same argument with no intervening space (i.e. +.QW \fB<\fIfileName\fR ). .TP 15 | Separates distinct commands in the pipeline. The standard output @@ -134,8 +137,9 @@ If standard output has not been redirected then the \fBexec\fR command returns the standard output from the last command in the pipeline, .VS 8.5 -unless ``2>@1'' was specified, in which case -standard error is included as well. +unless +.QW 2>@1 +was specified, in which case standard error is included as well. .VE 8.5 If any of the commands in the pipeline exit abnormally or are killed or suspended, then \fBexec\fR will return an error @@ -144,7 +148,7 @@ error messages describing the abnormal terminations; the \fB-errorcode\fR return option will contain additional information about the last abnormal termination encountered. If any of the commands writes to its standard error file and that -standard error isn't redirected +standard error is not redirected .VS 8.5 and \fB\-ignorestderr\fR is not specified, .VE 8.5 @@ -156,22 +160,27 @@ output. If the last character of the result or error message is a newline then that character is normally deleted from the result or error message. -This is consistent with other Tcl return values, which don't +This is consistent with other Tcl return values, which do not normally end with newlines. However, if \fB\-keepnewline\fR is specified then the trailing newline is retained. .PP -If standard input isn't redirected with ``<'' or ``<<'' -or ``<@'' then the standard input for the first command in the +If standard input is not redirected with +.QW < , +.QW << +or +.QW <@ +then the standard input for the first command in the pipeline is taken from the application's current standard input. .PP -If the last \fIarg\fR is ``&'' then the pipeline will be -executed in background. +If the last \fIarg\fR is +.QW & +then the pipeline will be executed in background. In this case the \fBexec\fR command will return a list whose elements are the process identifiers for all of the subprocesses in the pipeline. The standard output from the last command in the pipeline will -go to the application's standard output if it hasn't been +go to the application's standard output if it has not been redirected, and error output from all of the commands in the pipeline will go to the application's standard error file unless redirected. @@ -183,13 +192,16 @@ in the PATH environment variable are searched for an executable by the given name. If the name contains a slash then it must refer to an executable reachable from the current directory. -No ``glob'' expansion or other shell-like substitutions +No +.QW glob +expansion or other shell-like substitutions are performed on the arguments to commands. .SH "PORTABILITY ISSUES" .TP \fBWindows\fR (all versions) . -Reading from or writing to a socket, using the ``\fB@\0\fIfileId\fR'' +Reading from or writing to a socket, using the +.QW \fB@\0\fIfileId\fR notation, does not work. When reading from a socket, a 16-bit DOS application will hang and a 32-bit application will return immediately with end-of-file. When either type of application writes to a socket, the @@ -214,9 +226,13 @@ path separator, it may or may not be recognized as a path name, depending on the program. .PP Additionally, when calling a 16-bit DOS or Windows 3.X application, all path -names must use the short, cryptic, path format (e.g., using ``applba~1.def'' -instead of ``applbakery.default''), which can be obtained with the -\fBfile attributes $fileName -shortname\fR command. +names must use the short, cryptic, path format (e.g., using +.QW applba~1.def +instead of +.QW applbakery.default ), +which can be obtained with the +.QW "\fBfile attributes \fIfileName \fB\-shortname\fR" +command. .PP Two or more forward or backward slashes in a row in a path refer to a network path. For example, a simple concatenation of the root directory @@ -274,7 +290,8 @@ The Windows NT home directory. The directories listed in the path. .PP In order to execute shell built-in commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend the desired command with ``\fBcmd.exe /c\0\fR'' +the caller must prepend the desired command with +.QW "\fBcmd.exe /c\0\fR" because built-in commands are not implemented using executables. .RE .TP @@ -299,7 +316,8 @@ The Windows 9x home directory. The directories listed in the path. .PP In order to execute shell built-in commands like \fBdir\fR and \fBcopy\fR, -the caller must prepend the desired command with ``\fBcommand.com /c\0\fR'' +the caller must prepend the desired command with +.QW "\fBcommand.com /c\0\fR" because built-in commands are not implemented using executables. .PP Once a 16-bit DOS application has read standard input from a console and @@ -311,7 +329,9 @@ at this time. .PP Redirection between the \fBNUL:\fR device and a 16-bit application does not always work. When redirecting from \fBNUL:\fR, some applications may hang, -others will get an infinite stream of ``0x01'' bytes, and some will actually +others will get an infinite stream of +.QW 0x01 +bytes, and some will actually correctly get an immediate end-of-file; the behavior seems to depend upon something compiled into the application itself. When redirecting greater than 4K or so to \fBNUL:\fR, some applications will hang. The above problems do not @@ -410,7 +430,9 @@ differences in behaviour between \fBexec\fR and DOS batch files. .PP When in doubt, use the command \fBauto_execok\fR: it will return the complete path to the program as seen by the \fBexec\fR command. This -applies especially when you want to run "internal" commands like +applies especially when you want to run +.QW internal +commands like \fIdir\fR from a Tcl script (if you just want to list filenames, use the \fBglob\fR command.) To do that, use this: .CS |