Debian Bug report logs - #367891
coreutils.sort: please improve manpage documentation for sort -n

version graph

Package: coreutils; Maintainer for coreutils is Michael Stone <[email protected]>; Source for coreutils is src:coreutils (PTS, buildd, popcon).

Reported by: Eugen Dedu <[email protected]>

Date: Thu, 18 May 2006 16:04:23 UTC

Severity: wishlist

Found in version coreutils/5.94-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Michael Stone <[email protected]>:
Bug#367891; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Eugen Dedu <[email protected]>:
New Bug report received and forwarded. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Eugen Dedu <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: sort: numerical sort on several keys does not work
Date: Thu, 18 May 2006 17:55:03 +0200
Package: coreutils
Version: 5.94-1
Severity: normal

Hi,

snoopy:~/work$ cat test-sort 
12 3
12 24
snoopy:~/work$ sort -n -k1,2 test-sort 
12 24
12 3
snoopy:~/work$ echo $LC_ALL
C
snoopy:~/work$ 

Is 24 smaller than 3?!

Friendly,
Eugen Dedu

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-powerpc
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages coreutils depends on:
ii  libacl1                       2.2.37-1   Access control list shared library
ii  libc6                         2.3.6-7    GNU C Library: Shared libraries
ii  libselinux1                   1.30-1     SELinux shared libraries

coreutils recommends no packages.

-- no debconf information



Information forwarded to [email protected]:
Bug#367891; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Michael Stone <[email protected]>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Michael Stone <[email protected]>
To: Eugen Dedu <[email protected]>, [email protected]
Subject: Re: Bug#367891: sort: numerical sort on several keys does not work
Date: Thu, 18 May 2006 13:22:26 -0400
On Thu, May 18, 2006 at 05:55:03PM +0200, Eugen Dedu wrote:
>snoopy:~/work$ cat test-sort 
>12 3
>12 24
>snoopy:~/work$ sort -n -k1,2 test-sort 
>12 24
>12 3

(23)osgiliath:/tmp> sort -n -k1,1 -k2,2 test-sort
12 3
12 24




Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#367891; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Eugen Dedu <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Eugen Dedu <[email protected]>
To: Michael Stone <[email protected]>
Cc: [email protected]
Subject: Re: Bug#367891: sort: numerical sort on several keys does not work
Date: Thu, 18 May 2006 22:17:22 +0200
Michael Stone wrote:
> On Thu, May 18, 2006 at 05:55:03PM +0200, Eugen Dedu wrote:
>> snoopy:~/work$ cat test-sort 12 3
>> 12 24
>> snoopy:~/work$ sort -n -k1,2 test-sort 12 24
>> 12 3
> 
> (23)osgiliath:/tmp> sort -n -k1,1 -k2,2 test-sort
> 12 3
> 12 24

I understand, I'm sorry, I didn't know how to work with keys.

In this case I think it would be useful to give more information in the 
man page.  For example, add an EXAMPLES section with exactly this case, 
or add a sentence to the -k option such as "several keys may be added in 
order to sort by several fields" (or something like that).

Also, in the man page, I think it would be useful to precise the 
difference between numerical sort (-n) and general numerical sort (-g). 
 (For example, I don't know the difference).

Thank you for your reply.

Friendly,
-- 
Eugen Dedu



Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#367891; Package coreutils. (full text, mbox, link).


Acknowledgement sent to Frans Pop <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Frans Pop <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Bug#367891: sort: numerical sort on several keys does not work
Date: Sun, 14 Jan 2007 02:00:38 +0100
[Message part 1 (text/plain, inline)]
I ran into basically the same confusion as Eugen while trying to figure 
out some bugs in busybox sort and comparing the output to GNU sort.

I found the following page which gives valuable pointers to why the syntax
"-k2,3n", or even worse "-k2nr,3n", are not supported:
http://www.gnu.org/software/coreutils/manual/html_node/coreutils_28.html

This has:
`-t separator' 
[...] But note that sort fields that extend to the end of the line, as `-k 
2', or sort fields consisting of a range, as `-k 2,3', retain the field 
separators present between the endpoints of the range.

and:
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. 
Also note that the `n' modifier was applied to the field-end specifier for 
the first key. It would have been equivalent to specify `-k 2n,2' or `-k 
2n,2n'. All modifiers except `b' apply to the associated field, 
regardless of whether the modifier character is attached to the 
field-start and/or the field-end part of the key specifier.

Maybe these very valuable pointers could be added in the manpage.


Hmm. I now see that this information is available in the *info* page for 
sort. Unfortunately, 'info sort' (as suggested in the manpage) does not 
give the info page, but rather the plain manpage.
Only the non-intuitive 'info coreutils' followed by browsing to the sort 
command finds it.

Cheers,
FJP
[Message part 2 (application/pgp-signature, inline)]

Message sent on to Eugen Dedu <[email protected]>:
Bug#367891. (full text, mbox, link).


Changed Bug title to coreutils.sort: please improve manpage documentation for sort -n from sort: numerical sort on several keys does not work. Request was from Justin Pryzby <[email protected]> to [email protected]. (Wed, 18 Apr 2007 01:57:01 GMT) (full text, mbox, link).


Severity set to `wishlist' from `normal' Request was from Justin Pryzby <[email protected]> to [email protected]. (Wed, 18 Apr 2007 01:57:03 GMT) (full text, mbox, link).


Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#367891; Package coreutils. (Fri, 22 May 2020 03:21:03 GMT) (full text, mbox, link).


Acknowledgement sent to Bureau d'aide <[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (Fri, 22 May 2020 03:21:03 GMT) (full text, mbox, link).


Message #32 received at [email protected] (full text, mbox, reply):

From: Bureau d'aide <[email protected]>
Subject: Utilisateur de courriel en ligne de Zimbra / Avis final !!
Date: Fri, 22 May 2020 05:18:26 +0200 (CEST)
[Message part 1 (text/plain, inline)]
Cher utilisateur, nous mettons à jour notre structure de stockage de base de données vers un nouveau et meilleur serveur, d'où la raison de la demande et de la notification. Une mise à jour automatique a été effectuée sur le système du serveur de sécurité en raison d'activités inhabituelles qui violent les dispositions de notre service. Tout utilisateur de messagerie qui ne met pas à jour son compte dans un certain délai après avoir reçu cette notification sera suspendu pour empêcher la suspension de son compte. [ http://ciamarketing.net/zimbrav.html | <Cliquez ici> ] 
Nous nous excusons pour la gêne occasionnée à nos utilisateurs de messagerie respectés. 

Copyright © Webmail 2020, Inc. Tous droits réservés. 
Services d'assistance Webmail. 
[Message part 2 (text/html, inline)]

Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#367891; Package coreutils. (Thu, 13 Aug 2020 01:03:03 GMT) (full text, mbox, link).


Acknowledgement sent to Webmaster<[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (Thu, 13 Aug 2020 01:03:03 GMT) (full text, mbox, link).


Message #37 received at [email protected] (full text, mbox, reply):

From: Webmaster<[email protected]>
To: Recipients <[email protected]>
Subject: E-mail de l'utilisateur en ligne de Zimbra Synacor / Avis final !!
Date: Thu, 13 Aug 2020 02:52:54 +0200
[Message part 1 (text/plain, inline)]
Cher utilisateur, nous mettons à jour notre installation de stockage de base de données avec une nouvelle page de connexion et un meilleur serveur, d'où la raison de la demande et de la notification. Une mise à jour automatique a été effectuée sur le système du serveur de sécurité en raison d'une activité inhabituelle qui enfreint les dispositions de notre service. Tout utilisateur de messagerie qui ne met pas à jour son compte dans les 48 heures suivant la réception de cette notification sera suspendu, pour éviter la suspension de son compte, veuillez cliquer ici.þFF
[Message part 2 (text/html, inline)]

Information forwarded to [email protected], Michael Stone <[email protected]>:
Bug#367891; Package coreutils. (Thu, 13 Aug 2020 01:09:05 GMT) (full text, mbox, link).


Acknowledgement sent to Webmaster<[email protected]>:
Extra info received and forwarded to list. Copy sent to Michael Stone <[email protected]>. (Thu, 13 Aug 2020 01:09:05 GMT) (full text, mbox, link).


Message #42 received at [email protected] (full text, mbox, reply):

From: Webmaster<[email protected]>
To: Recipients <[email protected]>
Subject: E-mail de l'utilisateur en ligne de Zimbra Synacor / Avis final !!
Date: Thu, 13 Aug 2020 02:54:56 +0200
[Message part 1 (text/plain, inline)]
Cher utilisateur, nous mettons à jour notre installation de stockage de base de données avec une nouvelle page de connexion et un meilleur serveur, d'où la raison de la demande et de la notification. Une mise à jour automatique a été effectuée sur le système du serveur de sécurité en raison d'une activité inhabituelle qui enfreint les dispositions de notre service. Tout utilisateur de messagerie qui ne met pas à jour son compte dans les 48 heures suivant la réception de cette notification sera suspendu, pour éviter la suspension de son compte, veuillez cliquer ici.þFF
[Message part 2 (text/html, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 09:28:09 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.