bug-bash
[Top][All Lists]
Advanced

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

Re: Unexpected word splitting on $* when IFS is unset


From: Chet Ramey
Subject: Re: Unexpected word splitting on $* when IFS is unset
Date: Wed, 21 Jun 2017 09:54:57 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 6/20/17 1:33 AM, Eduardo A. Bustamante López wrote:
> On Tue, Jun 20, 2017 at 01:13:07AM +0100, Kevin Brodsky wrote:
> [...]
>> When IFS is unset, unquoted $* undergoes word splitting as if IFS=' ',
>> and not the expected IFS=$' \t\n'. All the other unquoted mass
>> This is a regression that appeared in 4.3 and is still present on devel
> [...]
> 
> AFAICT, the following patch fixes this.

It's on the right track, but you still need to differentiate between the
cases where IFS is unset (in which case the positional parameters need to
be separated into individual words, and those individual words need to be
split on $' \t\n') and where IFS is null (in which case split_on_spaces is
used as an internal flag to satisfy the Posix requirement that $* expand
into separate words no matter what IFS is set to).

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



reply via email to

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