autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Success (mostly) with the testsuite


From: Lars J. Aas
Subject: Re: Success (mostly) with the testsuite
Date: Fri, 20 Oct 2000 18:58:36 +0200
User-agent: Mutt/1.2.5i

On Fri, Oct 20, 2000 at 06:22:04PM +0200, Bernard Dautrevaux wrote:
: > test s${CONFIG_FILES+et} = set || CONFIG_FILES=$config_files
: 
: Hi all,
: 
: I usually use the following construct, to protect against any kind of value
: for FOO, be it empty or starting with a special character:
: 
: test X"${FOO+set}" = X"set" || FOO=$foo

I can appreciate having fixed conventions for things like this, and I
usually do quote on both sides of the =.

Anyways, what would be really cool is to find a LHS expansion that would
either expand to "set" or to "unset" depending on whether the variable was
set or not.  I haven't been able to think of one, though.  Does anyone
know it that could be done?

This trick is kind of cool, but it's the inverse of what I originally
looked for:

if test ${VAR+un}set != unset; then
  # VAR is set
fi

and

if test ${VAR+un}set != set; then
  # VAR is unset
fi

  Lars J



reply via email to

[Prev in Thread] Current Thread [Next in Thread]