← Back Home

Determine Bash Variable is Empty

  1. til

Determine If Variable is Empty

if [ -z "$VAR" ];

will return true if $VAR is unset or set to empty string

comments powered by Disqus