-----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 [EMAIL PROTECTED] -----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----- _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
