Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124
Matthew M. Boedicker wrote:
Sorry, this isn't a bug. Should have read the FAQ. "export LC_ALL=POSIX"
fixed it.
Well really that's just relying on the fact that '.' is before [0-9]
in the C locale. The following is more explicit/robust and should
work for all locales:
`info sort` has loads of great examples explaining this
(very confusing) behaviour. The essential point I'm quoting
from the info docs is:
"""
sort -t : -k 2,2n
Note that if you had written `-k 2' instead of `-k 2,2' `sort'
would have used all characters beginning in the second field and
extending to the end of the line as the primary _numeric_ key.
For the large majority of applications, treating keys spanning
more than one field as numeric will not do what you expect.
"""
I guess it's only has that confusing behaviour (i.e. not
treating the field specifier specially) for backwards compatability?
--
Pádraig Brady - http://www.pixelbeat.org
--