Q:

bash if set variable

if [ -z "$var" ]; then echo "var is blank"; else echo "var is set to '$var'"; fi
0
if [ -z ${var+x} ]; then echo "var is unset"; else echo "var is set to '$var'"; fi
0

New to Communities?

Join the community