Subject: Re: simple shell test question
To: None <netbsd-users@netbsd.org>
From: Wolfgang Rupprecht <wolfgang+gnus20020605T225611@wsrcc.com>
List: netbsd-users
Date: 06/05/2002 23:04:46
jamesb-netbsd@alongtheway.com (Jim Breton) writes:
> [ x"$VAR" != x"value" ]
>
> Does the 'x' have some special meaning? (If so, are there any other
> characters with special meanings?)
Belts and suspenders? *
The quotes should be enough for any sane shell, but why not hedge
one's bets a bit and insure that the zero-length string will be
interpreted correctly too?
Also under "sh -x" the zero length string is darn hard to tell from no
string. Putting an "x" there makes things easy to see.
-wolfgang
* Or seatbelts and airbags for the late 20th century crowd.
--
Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
http://www.wsrcc.com/wolfgang/
Coming soon: GPS mapping tools for Open Systems. http://www.gnomad-mapping.com/