How can I check if a variable is empty in Bash?
Presuming Bash:
var="" if [ -n "$var" ]; then echo "not empty" else echo "empty" fi