home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
dirs
/
tcl_447.lzh
/
TCL
/
tcl.lzh
/
tcl
/
help
/
exec
< prev
next >
Wrap
Text File
|
1990-05-03
|
1KB
|
28 lines
exec command arg1 arg2 ...[< input]
The exec command treats its command argument as the
name of a program to execute. It searches the
directories in the PATH environment variable to find an
executable file by the name command, then executes the
file, passing it an argument list consisting of command
plus all of the args. If an argument < appears
anywhere among the arguments to exec, then neither it
or the following argument is passed to command.
Instead, the following argument (input) consists of
input to the command; exec will create a pipe and use
it to pass input to command as standard input. Exec
also creates a pipe to receive command's output (both
standard output and standard error). The information
received over this pipe is returned as the result of
the exec command. The exec command also looks at the
return status returned by command. Normally this
should be zero; if it is then exec returns normally.
If command returns a non-zero status, then exec will
return that code; it should be one of the ones defined
in the section ``COMMAND RESULTS'' above. If an out-of
range code is returned by the command, it will cause
command unwinding just as if TCL_ERROR had been
returned; at the outermost level of command
interpretation, the Tcl interpreter will turn the code
into TCL_ERROR, with an appropriate error message.