24 Dec
2002
24 Dec
'02
13:12
Derek Fountain
perl -e 'print sort <>' < file > file.sorted
Anyway, both don't sort according to the current locale while the command "sort" does. See perllocale: ...
Never knew that. I guess locales don't apply too much to people who work in English all of the time?
Yes.
Anyway, is this the fix?:
perl -e 'use locale; print sort <>' < file > file.sorted
Yes. See the following: $ cat file B b a A $ export LC_ALL=cs_CZ # Czech language collation order $ perl -e 'print sort <>' < file A B a b $ perl -e 'use locale;print sort <>' < file A a B b To make it easy, I avoided accented characters. -- Alexandr.Malusek@imv.liu.se