bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #20883] sort -u -n drops more lines than expected


From: anonymous
Subject: [bug #20883] sort -u -n drops more lines than expected
Date: Fri, 24 Aug 2007 05:52:14 +0000
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6

URL:
  <http://savannah.gnu.org/bugs/?20883>

                 Summary: sort -u -n drops more lines than expected
                 Project: GNU Core Utilities
            Submitted by: None
            Submitted on: Friday 08/24/2007 at 05:52 UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Given the following example input:

1       3
2       1
1       1
3       1
1       2
1       1

sort -u gives the expected output:

1       1
1       2
1       3
2       1
3       1

But sort -n -u drops all lines that match the sort column:

1       3
2       1
3       1

Or compare sort -n -u -k2:

2       1
1       2
1       3

It's not clear from the info page that this is the correct behavior, but I
would expect sort -n -u to do the same as sort -n  | uniq, or for this
omitting equal keys (instead of equal lines) to be more explicit in the
documentation.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?20883>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]