what's the use of "{ list }" in /bin/sh?

Earl H. Kinmonth ked at garnet.berkeley.edu
Fri Jul 8 00:56:11 AEST 1988


>{
>  echo "This is an example of how"
>  echo "one can use the { list } "
>  echo "construct to re-direct the"
>  echo "output of several commands."
>  date
>  who
>} >$HOME/test.log
>

It should be noted that for this purpose { } has the advantage of
NOT forking another shell unlike ( ) used in the same manner.  On
the other hand if you have cd within the { }, the effect of the
cd will continue outside of the { } whereas with the ( )
construct, the effect is local.

E H. Kinmonth, Hist. Dept.,  Univ. of Ca., Davis Davis, Ca. 95616
916-752-1636/0776

Disclaimer:  This is AmeriKa!  Who needs a disclaimer!

Internet:  ehkinmonth at ucdavis.edu
           cck at deneb.ucdavis.edu
BITNET:    ehkinmonth at ucdavis
UUCP:      {ucbvax, lll-crg}!ucdavis!ehkinmonth
           {ucbvax, lll-crg}!ucdavis!deneb!cck



More information about the Comp.unix.questions mailing list