title: How to check if a number is within a range in shell
body: <p>I want to just insert number between two values, and otherwise the script repeated until correct number.</p>
  <p>This is my script and it does not work correctly:</p>
  <pre><code>validation(){
  read number
  if [ $number -ge 2 &amp;&amp; $number -ls 5 ]; then
      echo &quot;valid number&quot;
      break
  else
      echo &quot;not valid number, try again&quot;
  fi
  
  }
  
  echo &quot;insert number&quot;
  validation
  echo &quot;your number is&quot; $number
  </code></pre>