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: Fri, 23 Jun 2017 12:08:51 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 6/23/17 11:27 AM, Robert Elz wrote:
>     Date:        Thu, 22 Jun 2017 07:51:12 -0400
>     From:        Greg Wooledge <wooledg@eeg.ccf.org>
>     Message-ID:  <20170622115111.GQ22519@eeg.ccf.org>
> 
> 
>   | $ dash
>   | $ set -- a b
>   | $ IFS=
>   | $ args $*
>   | 1 args: <ab>
> 
> That is simply broken.  Always has been, whatever mistakes were
> in the wording posix used to use to try and explain how it works.

The historical Bourne shell produces <a b>.  (Of course, the historical
Bourne shell didn't allow IFS to be unset, either, so it's not a valid
reference implementation.)  Some current shells, like posh, do the same
thing.

-- 
``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]