You're right, my locale is set to fr_FR. I've tried with en_EN and
en_US, and it works fine (and with -k1,1 too).
I think I understand the problem with the locale fr_FR : in french, to
write 123456.78 in a easily readable form you write 123 456,78 (and in
english it's 123,456.78).
Thanks Philip and Andreas for your answers (and sorry for polluting the
bug mailing list).
Damien
Andreas Schwab a écrit :
Damien ANCELIN <[EMAIL PROTECTED]> 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.
--
Damien ANCELIN
INRIA - ENS-Lyon, LIP (RESO)
Bureau 322 Sud
Tel : +33 4 72 72 85 02
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils