On Tue, 24 Jan 2006 [EMAIL PROTECTED] 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 [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to