title: Shell scripting - which word is first alphabetically?
body: <p>How can you check which words is first alphabetically between two words?
  For example in the code</p>
  
  <pre><code>#!/bin/bash
  
  var1="apple"
  var2="bye"
  
  if [ $var1 \&gt; $var2 ]
  then
  echo $var1
  else
  echo $var2
  fi
  </code></pre>
  
  <p>I want it to print apple, since apple comes before bye alphabetically, but it isnt working as intended. What am I doing wrong?</p>