home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / processes / exec < prev    next >
Encoding:
Text File  |  1992-12-17  |  3.6 KB  |  64 lines

  1.           exec arg ?arg ...?
  2.                This command treats its arguments as the  specification
  3.                of   one   or   more   UNIX   commands  to  execute  as
  4.                subprocesses.  The commands take the form of a standard
  5.                shell  pipeline;  ``|''  arguments separate commands in
  6.                the pipeline and cause standard output of the preceding
  7.                command  to  be  piped  into standard input of the next
  8.                command.
  9.  
  10.                Under normal conditions the result of the exec  command
  11.                consists  of  the  standard output produced by the last
  12.                command in the pipeline.  If any of the commands in the
  13.                pipeline  exit  abnormally  or are killed or suspended,
  14.                then exec will return an error and  the  error  message
  15.                will  include  the  pipeline's output followed by error
  16.                messages  describing  the  abnormal  terminations;  the
  17.                errorCode  variable will contain additional information
  18.                about the last abnormal  termination  encountered.   If
  19.                any  of the commands writes to its standard error file,
  20.                then exec will return an error, and the  error  message
  21.                will   include   the  pipeline's  output,  followed  by
  22.                messages about abnormal terminations (if any), followed
  23.                by the standard error output.
  24.  
  25.                If the last character of the result or error message is
  26.                a  newline  then  that  character  is  deleted from the
  27.                result or error message for consistency with normal Tcl
  28.                return values.
  29.  
  30.                If an arg  has  the  value  ``>''  then  the  following
  31.                argument  is  taken  as  the  name  of  a  file and the
  32.                standard output of the last command in the pipeline  is
  33.                redirected  to  the  file.  In this situation exec will
  34.                normally return an empty string.
  35.  
  36.                If an arg  has  the  value  ``<''  then  the  following
  37.                argument  is  taken  as  the  name of a file to use for
  38.                standard input to the first command  in  the  pipeline.
  39.                If  an argument has the value ``<<'' then the following
  40.                argument is taken as an immediate value to be passed to
  41.                the  first  command  as standard input.  If there is no
  42.                ``<'' or ``<<'' argument then the  standard  input  for
  43.                the  first  command  in  the pipeline is taken from the
  44.                application's current standard input.
  45.  
  46.                If the last arg is  ``&''  then  the  command  will  be
  47.                executed  in  background.   In  this  case the standard
  48.                output from the last command in the pipeline will go to
  49.                the  application's standard output unless redirected in
  50.                the command, and error output from all the commands  in
  51.                the  pipeline  will  go  to  the application's standard
  52.                error file.
  53.  
  54.                Each arg becomes one word for  a  command,  except  for
  55.                ``|'',  ``<'',  ``<<'', ``>'', and ``&'' arguments, and
  56.                the arguments that follow  ``<'',  ``<<'',  and  ``>''.
  57.                The  first word in each command is taken as the command
  58.                name; tilde-substitution is performed on  it,  and  the
  59.                directories   in  the  PATH  environment  variable  are
  60.                searched for an  executable  by  the  given  name.   No
  61.                ``glob''  expansion  or  other shell-like substitutions
  62.                are performed on the arguments to commands.
  63.  
  64.