title: Integer comparison in Bash using if-else
body: <p>I have a variable called <code>choice</code>. Now, I try to use if to compare the entered value:</p>
  
  <pre><code>read $choice
  
  if [ "$choice" ==  2  ];then
         #do something
  elif [ "$choice" == 1 ];then
         #do something else
  else
       echo "Invalid choice!!"
  fi
  </code></pre>
  
  <p>The output goes directly to invalid choice if I enter either 1 or 2. I tried to put quotes around 1 and 2 inside the if statement. Still didn't work. Using <code>-eq</code> gives me an error "Unary operator expected".What am I doing wrong here?</p>