sample1.sh
#!/bin/bash
VAL="111"
echo $VAL
if [ -z ${VAL+x} ] ; then
echo not exists
else
echo exists
fi
if test "$VAL" = "" ; then
echo empty
else
echo exists
fi
unset VAL
echo $VAL
if [ -z ${VAL+x} ] ; then
echo not exists
else
echo exists
fi
if test "$VAL" = "" ; then
echo empty
else
echo exists
fi