bash input:
if [[ 167 > 10800 ]]
then
echo "I can't compare"
fi
bash output:
I can't compare
I guess the question is pretty obvious...
|
bash input:
bash output:
I guess the question is pretty obvious...
| |||||||||||||
feedback
|
|
To quote from the
So 167 is indeed greater than 10800 as 6 is a greater ASCII character than 0. | |||
|
feedback
|
|
The
And if you want to do a less-than comparison, you need to do | |||||||
|
feedback
|
|
Use curved brackets for a true numeric comparison
Good summary here: http://fvue.nl/wiki/Bash:_Numeric_comparison | |||
|
feedback
|