[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"
From: |
Eric Blake |
Subject: |
Re: [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"' |
Date: |
Thu, 09 Apr 2015 06:13:21 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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
Description: OpenPGP digital signature
- [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"', Bernhard Reutner-Fischer, 2015/04/08
- Re: [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"', Paul Eggert, 2015/04/08
- Re: [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"', Eric Blake, 2015/04/08
- Re: [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"', Eric Blake, 2015/04/08
- Re: [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"', Paul Eggert, 2015/04/09
- Re: [PATCH] Replace 'test "${var+set}" = set' with 'test -n "${var+set}"',
Eric Blake <=
- [PATCH 2/4] AC_PROG_LEX: Rephrase LEX is set test, Bernhard Reutner-Fischer, 2015/04/09
- Re: [PATCH 2/4] AC_PROG_LEX: Rephrase LEX is set test, Eric Blake, 2015/04/09
- Re: [PATCH 2/4] AC_PROG_LEX: Rephrase LEX is set test, Bernhard Reutner-Fischer, 2015/04/09
- [PATCH 0/4] misc test(1) invocation tweaks, Bernhard Reutner-Fischer, 2015/04/09
- Re: [PATCH 0/4] misc test(1) invocation tweaks, Eric Blake, 2015/04/09
- [PATCH 4/4] _AC_OUTPUT_FILES_PREPARE: Rephrase CONFIG_FILES test, Bernhard Reutner-Fischer, 2015/04/09
- Re: [PATCH 4/4] _AC_OUTPUT_FILES_PREPARE: Rephrase CONFIG_FILES test, Eric Blake, 2015/04/09
- Re: [PATCH 4/4] _AC_OUTPUT_FILES_PREPARE: Rephrase CONFIG_FILES test, Bernhard Reutner-Fischer, 2015/04/09
- [PATCH 3/4] AC_PROG_MKDIR_P: Also accept BusyBox mkdir -p, Bernhard Reutner-Fischer, 2015/04/09
- Re: [PATCH 3/4] AC_PROG_MKDIR_P: Also accept BusyBox mkdir -p, Eric Blake, 2015/04/09