Comparaisons numériques avec sort

2008-03-17

$ printf "1 21 5.0 2e1" | tr " " "\n" | sort -g
1
5.0
2e1
21
$ printf "1 21 5.0 2e1" | tr " " "\n" | sort -n
1
2e1
5.0
21
$ printf "1 21 5.0 2e1" | tr " " "\n" | sort
1
21
2e1
5.0