Subject: Re: CVS commit: src/bin/sh
To: None <source-changes@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: source-changes
Date: 06/08/2004 23:18:51
In article <20040608171531.GM1582@snowdrop.l8s.co.uk>,
David Laight <david@l8s.co.uk> wrote:
>On Tue, Jun 08, 2004 at 03:29:51AM +0000, Christos Zoulas wrote:
>> 
>> Module Name:	src
>> Committed By:	christos
>> Date:		Tue Jun  8 03:29:51 UTC 2004
>> 
>> Modified Files:
>> 	src/bin/sh: expand.c
>> 
>> Log Message:
>> "for i in ${x-a b c}; do echo $i; done" should print "a\nb\nc\n" not "a b c\n"
>> like other shells do. mark the expansion for ifs splitting. XXX: linux has a
>> very complicated fix for this. I wonder why.
>
>Having discovered the same fix last night, I was wondering if the result
>should be affected by quoting inside the {}.
>ie what should "for i in ${x-'a b' c}; do echo $i; done" generate?

a b
c

bleh.

This is the answer to my question above :-) My fix produces

a
b
c

which is wrong.

christos