Help with strings in Bourne shell

Jim Rudolf rudolf at oce.orst.edu
Mon Apr 24 17:53:30 AEST 1989


If I have a Bourne script called 'foo' and I call it with the arguments:
   foo "color = red" "size = big"
then from within foo they will be read as:
   $1 = "color = red"
   $2 = "size = big"
However, I want to read from stdin (or maybe a redirected pipe), and I
can't get it to work no matter what strange combination of quotes I use!
I would like to do something like:
   read args
   for i in $args
   .
   .
so I can process each string in turn.  Why can't I get this to work?
Do command line arguments get treated differently than arguments read
from within the script?  Any suggestions would be greatly appreciated.

Thanks,

Jim Rudolf

----------------------------------------------------------------------------
Internet: rudolf at oce.orst.edu                 "All opinions herein are mine" 
UUCP: {tektronix,hp-pcd}!orstcs!oce.orst.edu!rudolf
----------------------------------------------------------------------------



More information about the Comp.unix.questions mailing list