title: Shell script variable not empty (-z option)
body: <p>How to make sure a variable is <strong>not</strong> empty with the <code>-z</code> option ?</p>
  
  <pre><code>errorstatus="notnull"
  if [ !-z $errorstatus ]
  then
     echo "string is not null"
  fi
  </code></pre>
  
  <p>It returns the error :</p>
  
  <pre><code>./test: line 2: [: !-z: unary operator expected
  </code></pre>