Verifique se a variável bash é indefinida
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