GNU bug report logs -
#55622
Bug in sort with keys and reverse, and version-sort and reverse
Previous Next
Reported by: Larry Ploetz <lploetz <at> gmail.com>
Date: Wed, 25 May 2022 04:02:02 UTC
Severity: normal
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#55622: Bug in sort with keys and reverse, and version-sort and reverse
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 55622 <at> debbugs.gnu.org.
--
55622: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55622
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
On 25/05/2022 03:00, Larry Ploetz wrote:
> I think I've found a bug in sort (git branch master). The --reverse flag
> seems to be ignored when --keys are supplied.
>
> larryp-MBP:bin larry$ ./sort --version
> sort (GNU coreutils) 9.1.17-a351f
> Copyright (C) 2022 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later<https://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Written by Mike Haertel and Paul Eggert.
> larryp-MBP:bin larry$ ./sort -r <<< $'a\nb'
> b
> a
> larryp-MBP:bin larry$ ./sort -rk1,1 <<< $'a\nb'
> a
> b
Thanks for the report.
I pushed the following to address this
https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=4e0167ea1
The existing tests are sufficient to catch this.
thanks!
Pádraig
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
I think I've found a bug in sort (git branch master). The --reverse flag
seems to be ignored when --keys are supplied.
larryp-MBP:bin larry$ ./sort --version
sort (GNU coreutils) 9.1.17-a351f
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.
larryp-MBP:bin larry$ ./sort -r <<< $'a\nb'
b
a
larryp-MBP:bin larry$ ./sort -rk1,1 <<< $'a\nb'
a
b
This may be related to a bug reported in February where --version-sort
sorted incorrectly.
larryp-MBP:bin larry$ ./sort -Vr <<< $'1\n2'
1
2
larryp-MBP:bin larry$ ./sort -V <<< $'1\n2'
1
2
Current version:
larryp-MBP:bin larry$ sort --version
sort (GNU coreutils) 9.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.
larryp-MBP:bin larry$ sort -rk1,1 <<< $'a\nb'
b
a
Thanks,
· Larry
[Message part 5 (text/html, inline)]
This bug report was last modified 3 years and 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.