title: Bash if statement with logical OR
body: <p>I want the commands to execute only when the string variables are <strong>not equal</strong> to foo <strong>or</strong> any word starting with bar. </p>
  
  <pre><code>if [[ $string != "foo" || $string != bar* ]]; then
  commands
  fi
  </code></pre>
  
  <p>When $string=foo and I use the following code it works fine and no commands execute:</p>
  
  <pre><code>if [[ $string != "foo" ]]; then
  commands
  fi
  </code></pre>
  
  <p>but when I add the second part with the || the commands execute when they should not.</p>