Here is the documentation from the help test :
STRING1> STRING2
True if STRING1 sorts after STRING2 lexicographically.
Take your first if as an example:
if [[ "010" < "01." ]]; then echo "Wrong"; else echo "OK"; fi
In Bash, the string is "01." sorts lexicographically before the line "010" (you can test other tools, such as Microsoft Excel), so the comparison returns false. This applies to all 4 of your comparisons.
Note that adding an extra 0 to the end of "01." does not change the order compared to "010" , so you still get the same result.
Tim biegeleisen
source share