GNU bug report logs - #30661
sort: add sort-by-hex-number feature

Previous Next

Package: coreutils;

Reported by: James Bunke <james_a_bunke <at> yahoo.com>

Date: Thu, 1 Mar 2018 00:02:01 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: James Bunke <james_a_bunke <at> yahoo.com>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: sort
Date: Wed, 28 Feb 2018 23:42:59 +0000 (UTC)
[Message part 1 (text/plain, inline)]
To: bug-coreutils <at> gnu.org

This seems an oversight than an actual bug:

    'sort -n' thinks "B" is a larger value than "AA" -- yep! someone
forgot about hexadecimal, but binary, octal, and decimal work fine.

Suggestion: Don't revert to alphanumeric sorting until the rules are
broken by the sort field:

    1) There is an optional leading Plus(+) or Minus(-) but just one.
    2) There is an optional single Point(.) that may occur anywhere
       within the field except before an optional Plus or Minus.
    3) Numerals are limited to "0123456789ABCDEFabcdef".
    4) No white space, other letters, or other punctuation allowed or
       revert to alphanumeric sort.

Thank You,
J.B.

P.S.: Shouldn't be necessary to transform data to sort it...
      Use '-nx' or '-gx' if you must, but it shouldn't be needed.

[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.