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

Bruce Wehr wehr at fmeed1.UUCP
Thu Jul 7 04:32:10 AEST 1988


In article <23590 at teknowledge-vaxc.ARPA>, mkhaw at teknowledge-vaxc.ARPA (Mike Khaw) writes:
> "man sh" (on ultrix) says:
> 	{ list }
> 		The list is simply executed
> Under what circumstances is this useful (i.e., why whould one want to
> put braces around a list of commands)?

{
  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

{ echo "I hope these"; echo "examples are useful."; date; } 2>&1 | my.prog

-- 
                  Bruce Wehr ...!uunet!umix!teemc!fmeed1!wehr                   
            Ford Motor Company - Electrical and Electronics Division            
  17000 Rotunda Drive, DPTC Room LN081, Dearborn, Michigan 48121 (313)845-3039  



More information about the Comp.unix.questions mailing list