[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: How does a pipe works?
On Mon, 12 Jun 2000, RK Patil wrote:
> Shridhar Daithankar wrote:
> > Hi
> > When you run the command, it actually waits for reading from standard
> > input. But despite of that nothing comes in var, that you type is probably
> > because a \n that echo prints. Not sure on this...
If you use ps and strace -p on another console while
read foo|echo hello is running, you will find that 'read foo'
is running in a subshell. Naturally, foo will not be set in
the parent shell.