String comparison in bash 

Date: 9 Sep 2002 04:17:09 GMT
Newsgroups: comp.os.linux.misc
 > Bash manual says ">" and "<" can compare strings based on lexicography
order.
When used within [[ ]], not [ ].
> But:
>
> bash2.05>if [ "1.4" > "1.3" ]; then echo "okay"; fi
> okay
$ if [[ "1.4" > "1.3" ]]; then echo "okay"; fi
okay
> bash2.05>if [ "1.4" < "1.3" ]; then echo "okay"; fi
> okay
$ if [[ "1.4" < "1.3" ]]; then echo "okay"; else echo NOT; fi
NOT