Tree Tree - 7 months ago 10
Bash Question

How to find whether or not a variable is empty in Bash script

How can I check if a variable is empty in bash?

Jay Jay
Answer

In bash at least:

if [[ -z "$var" ]]

the command man test is your friend.

Comments