When I ran the following script
if [[ 10 -gt 2 ]]
then
echo "10 is greater than 2"
else
echo "10 is less than 2"
fi
it output the expected result
10 is greater than 2
However, when I ran the following one
if [[ 10 > 2 ]]
then
echo "10 is greater than 2"
else
echo "10 is less than 2"
fi
it output the following result
10 is less than 2
It seems like it's performing String comparison in this case. What are the logics behind these two?