title: How do bash's logical operators work (or why don't they work here)?
body: <p>I have the following wrapper script:</p>
  
  <pre><code>#!/bin/bash
  
  $local_time=`date +%H%M`
  if [ $local_time -ge 1430 ] &amp;&amp; [ $local_time -le 2230 ] ||
     [ $local_time -ge 0300 ] &amp;&amp; [ $local_time -le 0400 ]
  then
     echo 'pass'
  else
     echo 'skip'
  fi
  </code></pre>
  
  <p>The idea being to create a wrapper script that runs a script between two disjoint time intervals. Each of the expressions being OR'd is evaluated correctly, however, when I OR both expressions, the test fails.</p>
  
  <p>How do I fix this?</p>