autoconf
[Top][All Lists]
Advanced

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

Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?


From: Keith MARSHALL
Subject: Re: Why if test "xSTRING1= "xSTRING2" (the 'x') ?
Date: Mon, 26 Mar 2007 14:23:02 +0100

Jules Colding wrote:
> I'm wondering why I keep seeing the 
>
> if test "xSTRING1" = "xSTRING2" ...

The common idiom is `if test x$foo = xbar ...', and the `x' is
a placeholder, in case $foo happens to expand to nothing.  When
quotes are added, the `x' seems redundant, until the test goes
through a second round of evaluation; some writers leave the `x'
in place, just to be sure.

Regards,
Keith.




reply via email to

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