I\'m starting to learn about writing scripts for the bash terminal, but I can\'t work out how to get the comparisons to work properly. The script I\'m using is:
In bash, you should do your check in arithmetic context:
if (( a > b )); then ... fi
For POSIX shells that don't support (()), you can use -lt and -gt.
(())
-lt
-gt
if [ "$a" -gt "$b" ]; then ... fi
You can get a full list of comparison operators with help test or man test.
help test
man test