Murray Stokely wrote: > The current version of GNU sort on my Linux box incorrectly > sorts the following simple file, while an older version of GNU > sort on MacOS X 10.4 works fine.
Thanks for the report. It is most appreciated. However it matches a very common problem signature which is not usually a bug in sort. (Or ls or grep or others either.) It matches one of the FAQs, which by definition are asked frequently! :-) > $ sort --version > sort (coreutils) 5.2.1 Good. However a newer release are available. And yet another is being prepared for the near future so stay tuned. ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.92.tar.gz (7.2MB) ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.92.tar.bz2 (4.6MB) > $ sort scrambled > version0/data/r=2/1/42 12.3 > version0/data/r=2/1/45 3.2 > version0/data/r=2 146839.1 > version0/data/r=2/1/51 10.9 > version0/data/r=2/1/52 6.6 > version0/data/r=2/1/54 7.5 It sorts according to your 'locale'. If your locale specifies a dictionary sort order then case is folded and punctuation is ignored. That matches your example. What is the output of the locale program on your system? Some locales are dictionary sort order where case is folded and punctuation is ignored. locale This is an FAQ. Here is a semi-standard reply: Try this and then try your test again. unset LANG export LC_ALL=POSIX Please read this faq, look for "Sort does not sort" for the entry in question. http://www.gnu.org/software/coreutils/faq/ See your system and other standards documentation for how it reacts in the presence of locales. http://www.opengroup.org/onlinepubs/009695399/utilities/sort.html Hope that helps, Bob _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
