title: How to detect null values in shell?
body: <p>HI all,</p>
  
  <p>I wrote this code but it doesn't catch any of the two variables being null, why?</p>
  
  <pre><code>echo "$var1 - $var2"
  
  if [ "$var1" == ""] || [ "$var2" == ""]
  then
      echo "Incomplete data"
      exit 1
  fi
  </code></pre>
  
  <p>The initial echo prints nothing for the variables when I run my script so the if statement should work right? But it doesn't for some reason.</p>