Compruebe si la variable bash no está definida
if test -z "$var"
then
echo "\$var is empty"
else
echo "\$var is NOT empty"
fi
Super Dude
if test -z "$var"
then
echo "\$var is empty"
else
echo "\$var is NOT empty"
fi