Csh pipe/fork syncronization

Jay Liang jay at alliant.backbone.uoknor.edu
Fri Jul 13 08:22:35 AEST 1990


I am curious to know the correct sequence of csh pipes and forks
implementation.  Please look at the following script on machine A:

A% ps | grep ps
 4769 pc Run     0:00  ps 
 4798 pc Slp     0:00  grep ps 
A% ps | grep ps | grep ps
 2742 pc Slp     0:00  grep ps 
10085 pc Slp     0:00  grep ps
14611 pc Run     0:00  ps

and on machine B:

B% ps | grep ps
 8524  p3  R     0:01 ps
B% ps | grep ps | grep ps
 7657  p3  R     0:01 ps
B%

Machine A forks out subshells BEFORE processing the first command
where machine B processes the command line input in sequence.
All of the UNIX machines that I have access to acts like machine B
except one.  What is the _correct_ implementation if there is any?
Have you seen this before?  Am I missing something here?


Jay Liang (jay at alliant.backbone.uoknor.edu)
Geosciences Computing Network
University of Oklahoma
Norman, OK 73019



More information about the Comp.unix.questions mailing list