How to determine if a bash variable is empty?

This will return true if a variable is unset or set to the empty string (“”).

if [ -z "${VAR}" ];

Leave a Comment