VAR=`echo Hello world` if [[ -n "$VAR" ]] ; then echo "Variable is set" ; fi if [[ -z "$VAR" ]] ; then echo "Variable is null" ; fi