title: Comparing numbers in bash scripting
body: <p>I wrote this script to compare 2 numbers in bash but it gives me wrong answers for some numbers.
  like if I give it 2&amp;2 for input , it gives me "X is greater than Y" </p>
  
  <pre><code>#!/bin/bash 
  read num1
  read num2
  if [ $num1 &gt; $num2 ]
      then 
          echo "X is greater than Y"
  elif [ $num1 &lt; $num2 ]
      then 
          echo "X is less than Y"
  elif [ $num1 = $num2 ]
      then 
          echo "X is equal to Y"
  fi 
  </code></pre>