l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2002 Oct 19 17:01

The following is an archive of a post made to our 'vox mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[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


  export LC_ALL=C

it works as expected! :^)

I just thought I'd share that with y'all ... back to regular business...

vox mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.