[vox] sort and locale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vox] sort and locale
Ok, I obviously didn't read down far enough in the man page when this
problem first started occuring... :^)
Say you go to sort a file that has the following text in it:
!!Last First Email
Kendrick Bill nbs@sonic.net
Salzman Pete p@dirac.org
You expect it to pretty much come out exactly the same, no?
Well, lately, on _some_ systems, it's been coming out like so:
Kendrick Bill nbs@sonic.net
!!Last First Email
Salzman Pete p@dirac.org
Argh! Since when is "!" between "K" and "S"???
Ok - Well, I see what it's doing, of course. Ignoring the "!"s and
using the "L".
That's fine. More power to you, 'sort'... it's just, that's not what
I want!
Well, finally the answer has been pointed out. (Thanks to someone having
the same issue on SVLUG's list.)
It's a locale issue. When no particular locale is set, 'sort' was
defaulting to "en_US" - as mentioned on SVLUG's list: "undesired"
What we WANT is "C" or "POSIX" - which will sort by the value of the
character (i.e., ASCII).
So, if I do either:
export LC_COLLATE=C
or:
export LC_ALL=C
it works as expected! :^)
I just thought I'd share that with y'all ... back to regular business...
-bill!
_______________________________________________
vox mailing list
vox@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox
|