View Single Post
  #5   (View Single Post)  
Old 20th May 2013
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Here are a few selected quotes from man pages, which confirm what J65nko observed.

Quote:
Originally Posted by bash
Each command in a pipeline is executed as a separate process (i.e., in a subshell).
Quote:
Originally Posted by sh (NetBSD)
Note that unlike some other shells, each process in the pipeline is a child of the invoking shell (unless it is a shell built-in, in which case it executes in the current shell -- but any effect it has on the environment is wiped).
For ksh(1), I found nothing so explicit, but some implicit indications:

Quote:
Originally Posted by ksh
Job control refers to the shell's ability to monitor and control jobs, which are processes or groups of processes created for commands or pipelines.
... suggesting a pipeline is a group of processes (one for each command).

The above are examples of what I called "unexpected" behaviour. So far so good.

Now an oddity. The SunOS ksh has "expected" behaviour, but its man page says:

Quote:
Originally Posted by ksh SunOS
A pipeline is a sequence of one or more commands separated by |. The standard output of each command but the last is connected by a pipe(2) to the standard input of the next command. Each command is run as a separate process; ...
Reply With Quote