Shell commands and PIPELINES
A simple command is a sequence of words, the first of which specifies the
command to be executed. A simple command or a sequence of simple commands
separated by '|' characters forms a "pipeline". The output of each command in
a pipeline is connected to the input of the next. Sequences of pipelines may
be separated by ';', and are then executed sequentially. A sequence of
pipelines may be executed without immediately waiting for it to terminate by
following it with an '&'.
Some common examples:
show | lpr -Pprintername (print current message)
scan +inbox | more (page through inbox listing)
man ls | lpr -Pprintername (print the 'ls' manual page)
ls -l | fgrep a.out (list all a.out files)
Any of the above may be placed in parentheses form a simple command (which may
be a component of a pipeline, etc.). It is also possible to separate pipelines
with '||' or '&&', indicating, as in the C language, that the second is to be
executed only if the first fails or succeeds respectively.
|