next up previous
Next: Scripting Up: Shells Previous: Subprocesses

Command and Process Substitution

Many shells provide command substitution: the ability to use the output of a command as an argument to another.

eg1$ OS=`uname -s`

Wake up. This is cool. BASH also provides process substitution: The output of a command is stored in a temporary file, and that filename is substituted on the command line.

eg2$ comm <(cd /usr/bin;       /bin/ls) \
          <(cd /usr/local/bin; /bin/ls)



Reece Kimball Hart
1998-03-18