File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 969969need to check if \verb #pd[0] == 0 #.
970970\item It is better to create a pipe from a child to its parent as typically the
971971process writing the pipe finishes first, then the consumer reads the rest of the
972- data, processes it, and then finally exits. Remember , the shell waits for the
972+ data, processes it, and then finally exits. In general , the shell waits for the
973973program it started, i.e. the parent, and it does not care at all about children
974974the running program spawned during its life. If the pipe was created the other
975975way around, the shell could print the prompt after the parent finished while the
976- data from the child might still be flowing to the console.
976+ data from the child might still be flowing to the console. However, nowadays
977+ the shell waits for all processes in the pipeline. For example, the following
978+ will take 10 seconds before you get the prompt even though \texttt {cat(1) } might
979+ exit right away if \texttt {sleep(1) } closed its standard error before putting
980+ itself to sleep: \texttt {date | sleep 10 | cat }.
977981\item For example, the original \emph {Bourne shell } constructed a pipeline the
978982way that the last process created a child as its producer, that producer itself
979983created its child as its producer, and this continued until the whole pipeline
You can’t perform that action at this time.
0 commit comments