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: Paul Eggert
Subject: Re: sort 5.97 bug sorting a month embedded in a field
Date: Tue, 26 Sep 2006 23:20:45 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Gordon Grimes" <address@hidden> writes:

> (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

"sort --help" says "If neither the -t nor the -b option is in effect,
the characters in a field are counted from the beginning of the
preceding whitespace."  That's what's happening here.  So you want
sort -k2.5,2.7M, to take that white space into account.  There's no
bug.

(Now you have 18 years plus 1 day experience with 'sort'.  :-)




reply via email to

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