Grub Development Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Shewey <jdshewey@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: RE: Problem in configure
Date: Mon, 13 Oct 2008 07:33:17 -0400	[thread overview]
Message-ID: <48f331f2.102b400a.1f58.ffffd488@mx.google.com> (raw)

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 <Christian.Franke@t-online.de>
Sent: Monday, October 13, 2008 3:38 AM
To: The development of GRUB 2 <grub-devel@gnu.org>
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"
or
  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	other threads:[~2008-10-13 11:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 11:33 James Shewey [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-10-13  0:29 Problem in configure James Shewey
2008-10-13  1:08 ` James Shewey
2008-10-13  6:56   ` Clemens Helfmeier
2008-10-13  7:38     ` Christian Franke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48f331f2.102b400a.1f58.ffffd488@mx.google.com \
    --to=jdshewey@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox