bug-bash
[Top][All Lists]
Advanced

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

Re: ${1+"$@"} does not generate multiple words if IFS is empty


From: Chet Ramey
Subject: Re: ${1+"$@"} does not generate multiple words if IFS is empty
Date: Wed, 30 Dec 2015 13:21:31 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 12/29/15 10:40 PM, martijn@inlv.org wrote:
> Bash Version: 4.3
> Patch Level: 42
> Release Status: release
> 
> Description:
>       The substitution ${1+"$@"} should resolve to "$@" if there is at
>       least one parameter -- i.e. one word per parameter. This works fine
>       if IFS contains any character or is unset. If IFS is empty, it
>       instead resolves to the equivalent of "$*", i.e. a single word
>       concatenating all the parameters without a separator. IFS should
>       not influence the behaviour of "$@" under any circumstances.

Yes, thanks for the report.  This was `re-clarified' in a Posix group
discussion in October 2014 concerning how "$@" should be expanded in
various contexts, including those where field splitting would not be
performed.  It will be fixed for the next bash release.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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