echo \${$foo:?} one bash: bar: parameter null or not set bash: baz: parameter null or not set
== NOTE ==
The colon (:) in the above ope... ge produces the default message parameter null or not set.
Purpose:
Catching errors that result fro... e takes one argument and an optional one which is not a filename.
Despite their simplicity these two c... lt shell on Linux systems then there is no reason not to use these features when writing scripts for Li
Testing null strings and unquoted strings,
#+ but not strings and sealing wax, not to mention cabbages and kings . . .
# Using if... # Wrong result.
# Shows $string1 as not null, although it was not initialized.
echo
# Let's try it again.
if [ -... ng1 is quoted.
then
echo "String \"string1\" is not null."
else
echo "String \"string1\" is null.... stands naked.
then
echo "String \"string1\" is not null."
else
echo "String \"string1\" is null.