Re: (no subject)

From: guy keren (choo_at_nonexisting.hamakor.org.il)
Date: Wed 25 Jan 2006 - 23:28:56 IST


On Tue, 24 Jan 2006 hareldvd_at_ergolight-sw.com wrote:

> Hi all,
>
> In order to avoid using undefined variables one can use the syntax:
> echo ${badvarname:?}

there are other ways - reffering to underfined variables by itself is NOT
a syntax error.

> which will result in error message would the variable be bad (not "defined" or
> empty). This kind of reference is tedious therefore one could use ksh-u (in a
> script)

here's what i do in shell script:

if [ x"$BLA" == x ]; then
    echo "BLA is not set"
else
    echo "BLA - '$BLA'"
fi

this is an old trick which i've seen years ago somewhere.

-- 
guy
"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy
=================================================================
To unsubscribe, send mail to linux-il-request_at_linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request_at_linux.org.il


This archive was generated by hypermail 2.1.7 : Tue 24 Jan 2006 - 23:38:13 IST