bash if variable is set and not empty code example Example: bash check if variable is empty if [ -z "$var" ] #return true if $var is unset