[Bug 1240559] [NEW] sort applies -n option only to first key when key range is given

Darko Veberic 1240559 at bugs.launchpad.net
Wed Oct 16 14:58:05 UTC 2013


Public bug reported:

sort applies numerical comparison (-n) only on the first key of the -k
range. for instance, for an input file with contents

1 1   3
1 10 2
1 26 3
3 2   8
1 3   9

"sort -n -k1,2" will produce

1 10 2
1 1 3
1 26 3
1 3 9
3 2 8

it seems numerical comparison is used only for the first key in the
range and the rest of the keys are compared alphabetically.

with the -n or -g option one expects all comparisons are done
numerically...

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: coreutils 8.13-3.2ubuntu2.1
ProcVersionSignature: Ubuntu 3.5.0-41.64-generic 3.5.7.21
Uname: Linux 3.5.0-41-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.6.1-0ubuntu12
Architecture: amd64
Date: Wed Oct 16 16:49:49 2013
InstallationDate: Installed on 2012-11-22 (328 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
MarkForUpload: True
SourcePackage: coreutils
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: coreutils (Ubuntu)
     Importance: Undecided
         Status: Invalid


** Tags: amd64 apport-bug quantal

** Changed in: coreutils (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/1240559

Title:
  sort applies -n option only to first key when key range is given

Status in “coreutils” package in Ubuntu:
  Invalid

Bug description:
  sort applies numerical comparison (-n) only on the first key of the -k
  range. for instance, for an input file with contents

  1 1   3
  1 10 2
  1 26 3
  3 2   8
  1 3   9

  "sort -n -k1,2" will produce

  1 10 2
  1 1 3
  1 26 3
  1 3 9
  3 2 8

  it seems numerical comparison is used only for the first key in the
  range and the rest of the keys are compared alphabetically.

  with the -n or -g option one expects all comparisons are done
  numerically...

  ProblemType: Bug
  DistroRelease: Ubuntu 12.10
  Package: coreutils 8.13-3.2ubuntu2.1
  ProcVersionSignature: Ubuntu 3.5.0-41.64-generic 3.5.7.21
  Uname: Linux 3.5.0-41-generic x86_64
  NonfreeKernelModules: nvidia
  ApportVersion: 2.6.1-0ubuntu12
  Architecture: amd64
  Date: Wed Oct 16 16:49:49 2013
  InstallationDate: Installed on 2012-11-22 (328 days ago)
  InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
  MarkForUpload: True
  SourcePackage: coreutils
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1240559/+subscriptions



More information about the foundations-bugs mailing list