Daniel C. Sobral([EMAIL PROTECTED])@2001.10.02 09:18:43 +0000:
> Stijn Hoop wrote:
> > 
> > > Any way using `` won't work. for i in a "b c" d works, for instance, but
> > > there is not way that I know of that you can control the output this way
> > > using ``.
> > 
> > Yes there is: set IFS to only contain a newline beforehand. That's my local
> > hack, your way is probably better :)
> 
> But if you do that, you'll get a single argument back, instead of a
> number of arguments, some of which have space in the middle, or not?

you should save IFS somewhere, anyway.
you might do

[...]
OLDIFS="${IFS}"
IFS='
'
for i in "`command`"; do
    IFS="${OLDIFS}"
    echo "${i}" | read one two
    othercommand ${one} more arguments -paramaters ${two}
    IFS='
'
done
[...]

in bournish shells. i am a zsh user, so perhaps this won't work in
/bin/sh...

arguments should be parsed as expanded text, so it should not really
matter if you use them as subsequent arguments. the technique with
echo'ing the value through read splits it into the two variables.

does this make sense?

/k

-- 
> MCSE: Management Can't Send E-mail
KR433/KR11-RIPE -- WebMonster Community Founder -- nGENn GmbH Senior Techie
http://www.webmonster.de/ -- ftp://ftp.webmonster.de/ -- http://www.ngenn.net/
karsten&rohrbach.de -- alpha&ngenn.net -- alpha&scene.org -- [EMAIL PROTECTED]
GnuPG 0x2964BF46 2001-03-15 42F9 9FFF 50D4 2F38 DBEE  DF22 3340 4F4E 2964 BF46
Please do not remove my address from To: and Cc: fields in mailing lists. 10x

PGP signature

Reply via email to