title: difference between unset and empty variables in bash
body: <p>Using bash, what's the best method to check if a variable is empty or not?</p>
  
  <p>If I use:</p>
  
  <pre><code>if [ -z "$VAR" ]
  </code></pre>
  
  <p>as suggested in a forum this works for an unset variable but it is true when the variable is set but empty.
  Suggestions?</p>