Help with strings in Bourne shell

R. L. Welsh rikki at macom1.UUCP
Fri Apr 28 00:16:02 AEST 1989


>From article <19311 at adm.BRL.MIL>, by mchinni at pica.army.mil (Michael J. Chinni, SMCAR-CCS-E):
> Jim Rudolf <rudolf at oce.orst.edu> writes:
>> 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?

Try:
	\"x = value\"

This worked for me -- you need to get the " passed to the for line. 

>From vn Thu Apr 27 10:12:11 1989
Subject: Re: I Live
Newsgroups: dfw.test
References: <4498 at psuvax1.cs.psu.edu>

>From article <4498 at psuvax1.cs.psu.edu>, by Elvis at cup.portal.com (The King):
> Just testing.
> Elvis
Hi Elvis.

>From vn Thu Apr 27 10:13:21 1989
Subject: Re: test
Newsgroups: dc.test
References: <12610 at jhunix>
Distribution: dc

>From article <12610 at jhunix>, by tester at jhunix (tester):
> testing
Testing followup.

-- 
	- Rikki	(UUCP: grebyn!macom1!rikki)



More information about the Comp.unix.questions mailing list