Damien ANCELIN <address@hidden> writes:
I met a problem with the sort command : I've used the uniq command with
the -c option to count some numbers, and then applying sort -n don't sort
lines by numeric order of the first field.
Here is an example (my sort version is 5.97) :
$ cat bug_sort | sort -n
This is a useless use of cat, you can just redirect sort's standard
input from the file.
1320 51970
1692 12345
22681 8060
26063 8649
2668 33603
3487 44496
4350 23246
47013 8000
5447 20000
81724 5000
I assume that you use the fr_FR locale. In this locale a number can be
grouped with a space, thus it is considered part of the number. If you
want to be sure that sort only considers the first field as sort key you
should use -k1,1 to limit it. The default is to always use the the
whole line as sort key, and sort -n will take as much as possible from
the key to match a number.
Andreas.