title: Bash script: testing if floating point number is in a certain range including negative numbers
body: <p>I'm trying to test if the variable <code>$test</code> is between <code>-0.9</code> and <code>0.9</code>. The following code works with numbers, but if <code>$test</code> is a lower case letter, it says it's a number between <code>-0.9</code> and <code>0.9</code>.</p>
  
  <p>Is there a better way of doing this, so that letters are not considered to be in the range?</p>
  
  <pre><code>test=a
  
  if (( $( echo "$test &gt;= -0.9" |bc -l) )) &amp;&amp; (( $(echo "$test &lt;= 0.9" |bc -l) )); then
      echo "${test} is between -0.9 and 0.9"
  else
      echo "${test} is NOT between -0.9 and 0.9"
  fi
  </code></pre>