Re: [OT] question regarding sort(1)
On Sun, 2003-01-26 at 14:12, Bob Proulx wrote:
> Vineet Kumar wrote:
> > * Ron Johnson (ron.l.johnson@cox.net) [030126 11:22]:
> > > On Sun, 2003-01-26 at 11:40, Steve Juranich wrote:
> > > > On 26 January 2003 at 10:37,
> > > > Ron Johnson <ron.l.johnson@cox.net> wrote:
> > > >
> > > > > What I want, though, is a straight, dumb ASCII sort based on each whole
> > > > > line of text, where " " collates before "0", etc. I've looked in the
> > > > > man page, but see nothing.
>
> man sort
>
> The full documentation for sort is maintained as a Texinfo
> manual. If the info and sort programs are properly
> installed at your site, the command
>
> info sort
>
> Unless otherwise specified, all comparisons use the character
> collating sequence specified by the `LC_COLLATE' locale.
>
> Therefore your current locale directly controls sort ordering. This
> is a number one source of confusion for sort and ls and appears in the
> GNU coreutils faq.
>
> http://www.gnu.org/software/fileutils/doc/faq/
>
> > works for me:
>
> Me too.
>
> > doozer:/tmp% locale
> > LANG=en_US.UTF-8
>
> Veneet poses a good point. What is your locale?
>
> Try setting your locale to posix and see if that works for you.
>
> LC_ALL=POSIX sort < infile > outfile
Ah ha! That worked... Setting it to C also worked.
$ locale
LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
I'm sure I'll be back, if I can't figure out how to permanently change
the locale.
Thanks,
Ron
--
+---------------------------------------------------------------+
| Ron Johnson, Jr. mailto:ron.l.johnson@cox.net |
| Jefferson, LA USA http://members.cox.net/ron.l.johnson |
| |
| "Fear the Penguin!!" |
+---------------------------------------------------------------+
Reply to: