title: Combine Unix Test Commands && + ||
body: <p>KSH - HP-SOL-Lin
  Needs to be POSIX</p>
  
  <p>I want to test if multiple conditions are true, then do something.</p>
  
  <p>Assumptions:</p>
  
  <ul>
  <li><code>FIELDS=0</code></li>
  <li><code>$STRING=''</code> or <code>$STRING=' '</code></li>
  </ul>
  
  <p>Right now I have:</p>
  
  <pre><code>if [[ $FIELDS -ne 0 &amp;&amp; ! -z $STRING ]]; do
  </code></pre>
  
  <p>This works fine, if <code>$STRING</code> is null, but sometimes it has a single space. How can I make process the two <code>$STRING</code> tests first? Conceptually, I would like equivalent of:</p>
  
  <pre><code>[[ $FIELDS -ne 0 &amp;&amp; [ ! -z $STRING || $STRING = ' ' ]  ]]
  </code></pre>