On 2018-04-10, T <T...@invalid.invalid> wrote:
> if [ 2 \> 3 ]; then echo "2 greater than 3"; else echo "2 less than 3"; fi
>
> if [ 3 \> 2 ]; then echo "3 greater than 2"; else echo "3 less than 2"; fi
></code>
>
>
> 2 less than 3
> 3 greater than 2
Wow, a born computer scientist here!
If you want to test the strength of hypothesis, you have to look for
ways to make it **fail**, not try a some cherry-picked instances where
it works.
Do you know what "lexicographic" means? Loosely speaking, it means
comparing character strings like dictionary words.
Try this case:
if [ 2 > 11 ] ; then echo oops ; fi
The character string "11" is lexicographically anterior with respect
to "2".
Just like the word "eel" comes before the letter "d" in alphabetic order.
Yes; for certain pairs of strings which are the images of decimal
integers. lexicographic order does agree with numeric order. It will
certainly be that way if we compare strings of digits of equal length.