Shell Data Processing - Pipeline


A pipeline is a succession of command separated by a pipe operator.

We should have some ways of coupling programs like garden hose–screw in another segment when it becomes when it becomes necessary to massage data in another way. This is the way of IO also.


The format for a pipeline is

[!] command1 [ [| or |&] command2 ...]


  • ! is a negation of the exit code
  • a pair of brackets [ … ] means that the content is optional
  • | and |& are pipe operator

The standard output of command is connected via a pipe to the standard input of command2. This connection is performed before any redirections specified by the command.

If the pipe operator |& is used, the standard error of command1 is connected to command2's standard input through the pipe; it is a shorthand for 2>&1 |. This implicit redirection of the standard error is performed after any redirections specified by the command.

Powered by ComboStrap