General, /bin/sh, IO, etc...

Conor P. Cahill cpcahil at virtech.uucp
Wed Jun 6 11:13:03 AEST 1990


In article <SCOTT.90Jun5133413 at croaker.cs.odu.edu> scott at cs.odu.edu (Scott Yelich) writes:
>1)   Why does IFS affect the commands in a shell, not just the text?

Because that is hat it is supposed to do.  The shell has no idea of 
'text'.  It uses the IFS to parse all lines.

>     Do the braces { } create a sub shell (yic!)?

Not necessarily, but they will be if the input/output is redirected or if
the group is put in the background.  This is similar to the way that
while and/or for loops are processed.

>     What about functions?

Functions are run in the current shell unless run in the background.

>     I get the same number... but the process table shows ``cat'' by a
>different process number and it diagrams it as if it were a sub/child
>process!  

The problem with your example is that the $$ is interpreted when the 
controlling shell reads the lines (i.e. before the lines are executed). 

>   %tail -f file | tr "Aa"
>   Works...
>   %tail -f file | tr "Aa" |\
>    while read LINE
>    do
>      echo $LINE
>    done 
>    Doesn't work.

What do you mean by "doesn't work"?  I have used whiles at the end of pipelines
ithout any problems.


-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 



More information about the Comp.unix.questions mailing list