bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sort 5.97 bug sorting a month embedded in a field


From: Eric Blake
Subject: Re: sort 5.97 bug sorting a month embedded in a field
Date: Tue, 26 Sep 2006 20:45:34 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Gordon Grimes on 9/26/2006 6:01 PM:
> Hi,
> I'm unable to get "M" (month) to sort from within a field. See below.
> (I have 18 years experience with 'sort')
> 
> [529] > cat dates 
>     142 01-APR-2006
>      16 01-DEC-2005
>      31 01-FEB-2006
>      13 01-JAN-2006
>      55 01-MAR-2006
>   13312 01-MAY-2006
>       1 01-NOV-2005
>       1 01-OCT-2005
>     145 02-APR-2006
>      13 02-DEC-2005
> [533] > cat may_dates | sort -k2.4,2.6M   ## should work

Useless use of cat.  Try:
sort -k2.4,2.6M may_dates
to save a process.

>       1 01-NOV-2005
>       1 01-OCT-2005
>      13 01-JAN-2006
>      13 02-DEC-2005
>      16 01-DEC-2005
>      31 01-FEB-2006
>      55 01-MAR-2006
>     142 01-APR-2006
>     145 02-APR-2006
>   13312 01-MAY-2006

What's your locale?  And if it is not C, does 'LC_ALL=C sort' behave
differently?

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFGeXO84KuGfSFAYARAp11AKCXgAwtQsc1Fjjv1pxwA1YNsQav3gCgrdgs
LYMUafIVPb9OhYtEo6Bq/BQ=
=qK5o
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]