Paul Riggs wrote: > Is the "sort" command supposed to be case-sensitive? The info > pages imply that it is, but it does not seem to be in various tests I've > run on different versions of it including the current version (from > coreutils-5.2.1).
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 in 'ls' either. > For example: > > >ls > a B c > >ls |sort > a > B > c > >ls |sort -f > a > B > c It sorts according to your 'locale'. 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 The systems you mention above are probably setting LANG to a dictionary sort order locale without your knowledge. (I wish they would not do that.) 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/007908799/xcu/sort.html http://www.opengroup.org/onlinepubs/007908799/xbd/locale.html Hope that helps, Bob _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
