Subject: Re: bug#18073: defect with sort multiple arguments

From: Eric Blake <[email-masked]>
Date: Tue, 22 Jul 2014 10:44:40 -0600

[re-adding the bug, with permission]

On 07/22/2014 10:14 AM, n buckner wrote:
> Sorry didn't see this at the bottom of the manpage. info coreutils 'sort
> invocation'
> 
> The manpage is kind of misleading because it does not convey that at all.
> 
>        -n, --numeric-sort
>               compare according to string numerical value
> 
>        -u, --unique
>               with -c, check for strict ordering; without -c, output only
> the first of an equal run
> 
> 

If you think we can improve the documentation, to make it more obvious
that -u only covers uniqueness between keys, and that -n stops a key at
the first non-numeric character, suggestions are welcome.  Remember that
the man page is generated from the --help text, and that those are
supposed to be consise; but the info page should definitely go into more
detail.  And in fact, I see this in the info page:

     The commands 'sort -u' and 'sort | uniq' are equivalent, but this
     equivalence does not extend to arbitrary 'sort' options.  For
     example, 'sort -n -u' inspects only the value of the initial
     numeric string when checking for uniqueness, whereas 'sort -n |
     uniq' inspects the entire line.  *Note uniq invocation::.

which is _exactly_ what you filed this bug report about.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org