title: Compare negative numbers in bash
body: <p>How can i accomplish number comparison involving negative numbers?</p>
  
  <pre><code>if [[ "-2" &gt; "-1" ]]; then
      echo "-2 &gt;-1"
  else
      echo "-2 &lt;=-1"
  fi
  </code></pre>
  
  <p>I also tried </p>
  
  <pre><code>if [ '-2' -lt '-1' ]; then
  </code></pre>
  
  <p>but the condition always behaves as if -2 would be greater than -1.</p>
  
  <p>The comparisons work when i do not use negative numbers.</p>
  
  <p>I would like a solution in pure bash if possible.</p>