[Toybox] Would someone please explain what bash is doing here?

Chet Ramey chet.ramey at case.edu
Thu Mar 12 12:45:24 PDT 2020


On 3/12/20 12:53 PM, Rob Landley wrote:
> On 3/12/20 9:37 AM, Chet Ramey wrote:
>> On 3/11/20 11:55 PM, Rob Landley wrote:
>>> Word splitting isn't really a seperate step, exactly? "echo one two three"
>>> doesn't care about $IFS, and the output of any of the OTHER substitutions:
>>
>> It is, because it operates on the output of the other expansions. Like you
>> said, that echo command doesn't undergo word splitting at all.
> 
> The relationship between variable expansion, word splitting, and quote removal
> is most _politely_ described as "incestuous".

Oh, indeed. The various splitting semantics and expansion semantics when
"in a context where word splitting will be performed" (or not) have been a
fruitful source of bugs and inconsistencies.

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


More information about the Toybox mailing list