From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16504 invoked by alias); 3 Aug 2010 21:29:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28125 Received: (qmail 10593 invoked from network); 3 Aug 2010 21:29:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at spf-1.redhat.com designates 209.132.183.28 as permitted sender) Message-ID: <4C5889E5.3070307@redhat.com> Date: Tue, 03 Aug 2010 15:28:05 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.1.1 MIME-Version: 1.0 To: Mikael Magnusson CC: zsh-workers@zsh.org, Autoconf@gnu.org Subject: Re: Fix testsuite errors due to shell quoted parameter expansion issue. References: <20100803203204.GG13690@gmx.de> <4C588248.9050807@redhat.com> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigFEF4E6A59DE047BBD9666C2E" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 --------------enigFEF4E6A59DE047BBD9666C2E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable [trimming the cc a bit] On 08/03/2010 03:21 PM, Mikael Magnusson wrote: >> But it is _also_ a bug in zsh; adding zsh-workers accordingly. >> >> $ zsh -cvx 'f=3D" val" e=3D; echo "$e"$f' >> +zsh:1> f=3D' val' e=3D'' >> +zsh:1> echo ' val' >> val >> >> Oops - zsh only passed one argument to echo, with a leading space, >> instead of passing an empty argument and letting echo supply the space= =2E >> ksh93, pdksh, and dash get it right (although dash doesn't use quotes= >> in -vx output, hence my use of n() to force things to tell; n() is >> another way to expose the bash and zsh bugs). >=20 > zsh doesn't do word splitting by default, you can enable it with the =3D= modifier: > % zsh -fcvx 'f=3D" val" e=3D; echo "$e"$=3Df' > +zsh:1> f=3D' val' e=3D'' > +zsh:1> echo '' val > val >=20 > does what you want Thanks for the information. >=20 > Alternatively you can make zsh try to be closer to sh by setting > argv[0] to sh when executing it, or running 'emulate sh' as the first > command (and possibly other ways I don't know about): > % zsh -fcvx 'emulate sh;f=3D" val" e=3D; echo "$e"$f' > +zsh:1> emulate sh > +zsh:1> f=3D' val' e=3D'' > +zsh:1> echo '' val > val In the context of portable shell programming, and autoconf in particular, we already _always_ force zsh into 'emulate sh' mode, so that we don't trip up on non-POSIX incompatibilities like this behavior of word splitting. So it should not be a problem for autoconf, other than to remind users that portable programming requires the use of 'emulate sh' in scripts that don't pick up autoconf's automatic shell sanitization prelude. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigFEF4E6A59DE047BBD9666C2E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJMWInlAAoJEKeha0olJ0NqPREH/i/clAb8u80YKWgEf2qOhsOV GJ4fowYqika30aQu/doibA22fKPNzbmrTEb1RpuNsi8nlFNkWhxiO/Vkx+8jc2g7 EZx3TZEAELokLHZjOHyz+lq1BczT+hivjJwAkx7kHzKT+LbbNpIm06cmexVY1y++ x/W9VKywkP6PodMCXZos1TnjoKHU7inXNc9ad1Gnoy0uH2GThrQGBSOBjsVNd1fP qXUUFifipRRSm2eRoSmHMOWz0BoQYsVf9dRyEVlC1H4Q67txD6+AcyOq4qEGU8cH 22OOMMDLVepvHiZA5EJLCqfcInskrL5kO8o7V7lEPBDHk1ORMcyO271Q3KLzavQ= =FFFn -----END PGP SIGNATURE----- --------------enigFEF4E6A59DE047BBD9666C2E--