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 I prefer doing this as it addresses itself more as a conditional operation unlike using (( ))
which is more of arithmetic.
[[ N -gt M ]]
Unless I do complex stuffs like
(( (N + 1) > M ))
But everyone just has their own preferences. Sad thing is that some people impose their unofficial standards.
Update:
You actually can also do this:
[[ 'N + 1' -gt M ]]
Which allows you to add something else which you could do with [[ ]]
besides arithmetic stuff.