bug-bash
[Top][All Lists]
Advanced

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

Re: Curious special parameter expansion when IFS is null


From: A. Alper ATICI
Subject: Re: Curious special parameter expansion when IFS is null
Date: Mon, 9 Feb 2004 16:57:02 +0200
User-agent: Mutt/1.5.4i

On Sun, Feb 08, 2004 at 07:10:55PM -0500, Chet Ramey wrote:
> A. Alper ATICI wrote:
> >Bash Version: 2.05b
> >Patch Level: 0
> >Release Status: release
> >
> >Description:
> >
> >$ set a b c; IFS=, a=$* b="$*"; echo $a; echo "$a"; echo $b; echo "$b"
> >a b c
> >a,b,c
> >a b c
> >a,b,c
> >
> >$ set a b c; IFS= a=$* b="$*"; echo $a; echo "$a"; echo $b; echo "$b"
> >a b c
> >a b c
> >abc
> >abc
> >
> >Considering the output when IFS=, is correct; what's the explanation
> >of the output when IFS is null unless it is a bug?
> 
> Which part do you consider a bug?
> 

All right, I've just noticed I overlooked word-splitting while making that post.


> For the assignment to `a', the standard requires that, when unquoted, $*
> expand to the positional parameters starting from 1.  It has to be done
> in such a way that even when IFS is null they expand into separate
> arguments.  (So there is no difference between $@ and $* when unquoted.)

However, there seems to be undocumented behaviour for $* when assigned to 'a', 
unless 
it is implied obviously (which I fail to get), that IFS is used in 
concatenating 
parameters into a single word unless IFS is null, or a space otherwise.

regards,

-- 
A. Alper ATICI
PGP keys @ http://web.ttnet.net.tr/alperatici/anahtar.asc
fpr(S) = DFA9 6619 70C7 400C 1DA8  7BFB 2C56 F3AF B824 F550 
fpr(E) = D314 04FF 7A8C EBE0 68AE  D692 A1B5 A14B C0CD 4D4A





reply via email to

[Prev in Thread] Current Thread [Next in Thread]