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

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

 



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.


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux