GNU bug report logs - #14226
Sort -c takes in account fields that were outside sorting scope

Previous Next

Package: coreutils;

Reported by: Camion SPAM <camion_spam-gnubugs <at> yahoo.fr>

Date: Thu, 18 Apr 2013 17:11:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


Message #21 received at 14226-done <at> debbugs.gnu.org (full text, mbox):

From: Camion SPAM <camion_spam-gnubugs <at> yahoo.fr>
To: Eric Blake <eblake <at> redhat.com>
Cc: "14226-done <at> debbugs.gnu.org" <14226-done <at> debbugs.gnu.org>
Subject: Re: bug#14226: Sort -c takes in account fields that were outside
	sorting scope
Date: Sun, 21 Apr 2013 01:59:57 +0100 (BST)
[Message part 1 (text/plain, inline)]
Then, I suggest adding after -c : 
  -c, --check, --check=diagnose-first  check for sorted input; do not sort

>> Note that, when selecting fields with -k while using the -c switch, user should probably also disable the last-resort comparison with -s to obtain the expected result.

after -k : 

  -k, --key=POS1[,POS2]     start a key at POS1 (origin 1), end it at POS2 (default end of line) 
>> By default, if two lines are considered equivalent regarding the key specification, sort will try to resolve the equivalence by comparing the whole lines. This is called the "last-resort comparison" (and may be disabled with -s)

and after -s :
  -s, --stable              stabilize sort by disabling last-resort comparison

>> (See -k)


________________________________
 De : Eric Blake <eblake <at> redhat.com>
À : Camion SPAM <camion_spam-gnubugs <at> yahoo.fr> 
Cc : "14226-done <at> debbugs.gnu.org" <14226-done <at> debbugs.gnu.org> 
Envoyé le : Samedi 20 avril 2013 17h54
Objet : Re: bug#14226: Sort -c takes in account fields that were outside sorting scope
 

On 04/19/2013 06:56 PM, Camion SPAM wrote:
> Well, I'm satisfied with your suggestion of adding -s. 
> I would just add that this might be something that should be added to the man page.

The man page is generated from 'sort --help', and there, we are trying
to favor brevity.  But it might indeed be worth adding to the 'info
sort' page.  I read that page, and notice that while '-c' and '-C' are
mentioned first, details about '-k' and '-s' are several screenfuls
away, so it is not obvious that those two options can affect the
behavior of -c.  You could help by reading that page, and finding the
spot(s) where adding a sentence would have helped you; if you could
propose the location and wording to add, then we can work with that to
turn it into a formal patch.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[Message part 2 (text/html, inline)]

This bug report was last modified 12 years and 112 days ago.

Previous Next


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