Subject: bin/22182: sort(1) fields `rn' options may give incorrect results
To: None <gnats-bugs@gnats.netbsd.org>
From: None <njoly@pasteur.fr>
List: netbsd-bugs
Date: 07/18/2003 18:51:49
>Number: 22182
>Category: bin
>Synopsis: sort(1) fields options give incorrect results: -rn -k1 <> -k 1rn
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jul 18 16:52:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Nicolas Joly
>Release: NetBSD 1.6U (Thu Jul 17 14:25:58 CEST 2003)
>Organization:
Pasteur Institute, Paris.
>Environment:
System: NetBSD calamity.sis.pasteur.fr 1.6U NetBSD 1.6U (CALAMITY) #7: Wed Jul 9 23:44:31 CEST 2003 njoly@calamity.sis.pasteur.fr:/local/src/NetBSD/src/sys/arch/i386/compile/CALAMITY i386
Architecture: i386
Machine: i386
>Description:
Using fields options may leads to incorrect results on sorting numbers
By example (see below), sort -rn -k 1 and sort -k 1rn give different
results.
>How-To-Repeat:
njoly@hal [~]> cat > xx
1599
1501
1500
1499
1401
1400
njoly@hal [~]> sort -rn -k 1 xx
1599
1501
1500
1499
1401
1400
njoly@hal [~]> sort -k 1rn xx
1500
1599
1501
1400
1499
1401
>Fix:
N/A
>Release-Note:
>Audit-Trail:
>Unformatted: