Subject: Re: recent /bin/sh changes problems
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: current-users
Date: 06/09/2004 12:15:46
In article <20040609114344.GA511427@medusa.sis.pasteur.fr>,
Nicolas Joly <njoly@pasteur.fr> wrote:
>
>Hi,
>
>I rencently reported a problem for field splitting in /bin/sh. This
>was promptly fixed by christos (thanks a lot for looking at this).
>
>But now, i hit some other problems; especially with shell scripts
>command line, where arguments seems duplicated :
>
>njoly@lanfeust [tmp/sh]> cat foo.sh 
>#! /bin/sh
>echo ${1+"$@"}
>njoly@lanfeust [tmp/sh]> ./sh.new foo.sh a b c
>a b c b c
>njoly@lanfeust [tmp/sh]> ./sh.old foo.sh a b c
>a b c

The fix is broken in more than one ways and it has been backed out.
Consider
for i in ${x-'a b' c}; do echo $i; done

christos