[Top][All Lists]

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

RE: Problem in configure

From: James Shewey
Subject: RE: Problem in configure
Date: Mon, 13 Oct 2008 07:33:17 -0400

Ahh. That makes sense. Interesting bit of history there. The x in the left side 
of the evuation is what threw me. I didn't think that would even be legal 
syntactically, but those explanations make a lot of sense.

- James

-----Original Message-----
From: Christian Franke <address@hidden>
Sent: Monday, October 13, 2008 3:38 AM
To: The development of GRUB 2 <address@hidden>
Subject: Re: Problem in configure

Clemens Helfmeier wrote:
> This is a shell thing. It just ensures that the evaluation does not
> result in if test = xno; then
> (in case the variable is empty) and thus throw an error. with "x" it
> its like this for an empty variable
> if test x = xno; then
> which would work fine for shells.

BTW: This is not necessary if the expanded argument is quoted like in
the original example.

Instead of
  test "x$foo" = "xno"
it is OK to use:
  test "$foo" = "no"
  test "$foo" = no
which is IMO more easy to read. For an unset/empty variable, this
expands to
  test "" = no
which does not throw an error.

The leading 'x' was probably necessary for very ancient shells with
broken evaluation of quoted empty argument.

[The entire original message is not included]

reply via email to

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