home *** CD-ROM | disk | FTP | other *** search
- exec arg ?arg ...?
- This command treats its arguments as the specification
- of one or more UNIX commands to execute as
- subprocesses. The commands take the form of a standard
- shell pipeline; ``|'' arguments separate commands in
- the pipeline and cause standard output of the preceding
- command to be piped into standard input of the next
- command.
-
- Under normal conditions the result of the exec command
- consists of the standard output produced by the last
- command in the pipeline. If any of the commands in the
- pipeline exit abnormally or are killed or suspended,
- then exec will return an error and the error message
- will include the pipeline's output followed by error
- messages describing the abnormal terminations; the
- errorCode variable will contain additional information
- about the last abnormal termination encountered. If
- any of the commands writes to its standard error file,
- then exec will return an error, and the error message
- will include the pipeline's output, followed by
- messages about abnormal terminations (if any), followed
- by the standard error output.
-
- If the last character of the result or error message is
- a newline then that character is deleted from the
- result or error message for consistency with normal Tcl
- return values.
-
- If an arg has the value ``>'' then the following
- argument is taken as the name of a file and the
- standard output of the last command in the pipeline is
- redirected to the file. In this situation exec will
- normally return an empty string.
-
- If an arg has the value ``<'' then the following
- argument is taken as the name of a file to use for
- standard input to the first command in the pipeline.
- If an argument has the value ``<<'' then the following
- argument is taken as an immediate value to be passed to
- the first command as standard input. If there is no
- ``<'' or ``<<'' argument then the standard input for
- the first command in the pipeline is taken from the
- application's current standard input.
-
- If the last arg is ``&'' then the command will be
- executed in background. In this case the standard
- output from the last command in the pipeline will go to
- the application's standard output unless redirected in
- the command, and error output from all the commands in
- the pipeline will go to the application's standard
- error file.
-
- Each arg becomes one word for a command, except for
- ``|'', ``<'', ``<<'', ``>'', and ``&'' arguments, and
- the arguments that follow ``<'', ``<<'', and ``>''.
- The first word in each command is taken as the command
- name; tilde-substitution is performed on it, and the
- directories in the PATH environment variable are
- searched for an executable by the given name. No
- ``glob'' expansion or other shell-like substitutions
- are performed on the arguments to commands.
-
-