how to check if a string variable is empty in linux code example Example: bash check if variable is empty if [ -z "$var" ] #return true if $var is unset