Re: [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"'
Eric Blake <[email protected]>
| Newsgroups | gmane.comp.sysutils.autoconf.patches |
|---|---|
| Organization | Red Hat, Inc. |
| Message-ID | <[email protected]> |
On 04/09/2015 12:49 AM, Paul Eggert wrote:
> Eric Blake wrote:
>> test ${var+y}
>
> Hah! Here's something that's one byte shorter:
>
> ${var+:} [ ]
>
> It may be clearer to write it more in the style you used:
>
> [ ${var+y} ]
>
> Both of these work with Solaris 10 /bin/sh.
But both become more difficult to express in autoconf, where [] also has
meaning to m4 quoting.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
(application/pgp-signature, 604 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVJmzhAAoJEKeha0olJ0NquKEIAJ6LpMR6rMnbr+t83/Xjtw67 jIi29C5EjgJNEDK7O0IU+DUWhjaEZprUTY/YX8uC29Jl3j9hBNc2HHsIDwc1FW/T BIMdX69svvEshdozSSkjkBx8w2xYToHf2wWxA/Un75QkmXFZVe8Jp4MBdWopjhj4 2Cxr/biihK0VaPWK++PQKGCSLWn8QXUVNw14m1ikUO5vtuZzJgQLbphfnVvlzXDW KG5jPdoZXpuYhPa0SPI7mJ0D+rmzAfDRZf2MtKkJ0a25ctfp2zTgKqWgYp5ZSyf0 RQRgAHvHexy76Sqn4hFQGdJFltOMZycpEEPInWKfF4BKSVp1NV25fKOqs8Uhb9c= =CtLg -----END PGP SIGNATURE-----