[Wolves] Shell Script "text variable"

chris procter chris-procter at talk21.com
Mon Jan 16 17:55:51 GMT 2006


--- David Goodwin <dg at clocksoft.com> wrote:
> read someVariable
> 
> After this, $someVariable can be used, e.g.
> 
> if [ "x$someVariable" == "xSomething" ]; then
>      # do something here.
> fi
> 
> David.

Why do you have the x at the beginning of the strings
in the test?  Are you trying to provide a default
value in case $someVariable isn't set (in which case
you dont need it as long as you quote the strings so
it defaults to "" if its null) or is this some arcane
hacker magic?

chris


		
___________________________________________________________ 
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/



More information about the Wolves mailing list