[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CVS automake testsuite failures on NetBSD i386 2.0F
From: |
Nicolas Joly |
Subject: |
Re: CVS automake testsuite failures on NetBSD i386 2.0F |
Date: |
Tue, 8 Jun 2004 11:54:06 +0200 |
User-agent: |
Mutt/1.5.5.1i |
On Sun, Jun 06, 2004 at 11:42:28PM +0200, Nicolas Joly wrote:
> On Sun, Jun 06, 2004 at 10:40:55PM +0200, Alexandre Duret-Lutz wrote:
> > >>> "Nicolas" == Nicolas Joly <address@hidden> writes:
> >
> > I can see this on NetBSD 1.6.1 too:
> >
> > $ for i in a b c; do echo $i; done
> > a
> > b
> > c
> > $ for i in ${x-a b c}; do echo $i; done
> > a b c
> > $ x='x y'
> > $ for i in ${x-a b c}; do echo $i; done
> > x
> > y
> >
> > This looks like a bug in NetBSD's sh to me. POSIX says field
> > splitting should occur after parameter expansion, and replacing
> > ${x-a b c} by "x y" or "a b c" is part of parameter expansion.
> > So where the value comes from should not make any difference.
>
> > May I let you report this to the NetBSD people? I'm not a
> > NetBSD user myself, while it looks like you're running bleeding
> > edge.
A fix has been commited on -current :
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.
It works better now.
address@hidden [~]> /bin/sh
$ for i in a b c; do echo $i; done
a
b
c
$ for i in ${x-a b c}; do echo $i; done
a
b
c
$ x='x y'
$ for i in ${x-a b c}; do echo $i; done
x
y
--
Nicolas Joly
Biological Software and Databanks.
Institut Pasteur, Paris.