[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IFS behaviour (was: ash vs. bash)

>>>>> "Paul" == Paul Slootman <paul@wau.mis.ah.nl> writes:
    Paul> The current behaviour seems to be that IFS is only being
    Paul> used when evaluating things the second time round;
    Paul> i.e.. like this:

    Paul> $ IFS=":$IFS" 
    Paul> $ set a:b:c 
    Paul> $ echo "$1" 
    Paul> a:b:c 
    Paul> $ echo $1 
    Paul> a b c

Eh? ash on my laptop gives the following

$ IFS=":$IFS"
$ set a:b:c
$ echo $1
a b c
$ echo "$1"

    Paul> Can anyone shed some light on this? Is this something
    Paul> mandated by POSIX?  I mean, it's too much of a coincidence
    Paul> that ash, bash, ksh all have this new (and for me
    Paul> unexpected) behaviour.  It also shed new light on the
    Paul> meaning of "Bourne shell compatibility"; I'll look this up
    Paul> in the book I have at home written by Bourne himself...

I think perhaps studying the influences of "" on command-line
arguments would be valuable. :)

"If 8-year-old boys discharging loaded firearms into their own legs
isn't necessary to the maintenance of a well-regulated militia, I
don't know what is." - Randal Cummings as reported in The Onion, 25/5/99

Reply to: