title: Logical AND in shell script while loop
body: <p>I am trying to compare dates in the <code>while</code> loop of a shell script. The shell script will be controlled by 2 conditions, like the following:</p>
  
  <pre><code>while [ $currentDate -le $currentDateMonthEnd -a $currentDate -le $toDate ]; do
  ...
  done
  </code></pre>
  
  <p>The above is my current code, which complains of <code>"integer expression expected"</code>. I have also tried using <code>&amp;&amp;</code> and <code>AND</code>, which also do not work and complains of mismatching braces.</p>
  
  <p>Could someone please provide the syntax to make the above comparison?</p>