NetBSD-Bugs archive

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

bin/51726: sort -n ignored if given after -k



>Number:         51726
>Category:       bin
>Synopsis:       sort -n ignored if given after -k
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 17 17:20:00 +0000 2016
>Originator:     David Brownlee
>Release:        7.0_STABLE
>Organization:
>Environment:
NetBSD iris.absd.org 7.0_STABLE NetBSD 7.0_STABLE (GENERIC.201610051330Z) amd64

>Description:
If -n is given after -k on the command line it appears to be ignored.

I found a script which was running "sort -k 3 -n -r"

On NetBSD-7 it looks like the -n does not take effect as it happens after the -k 3, while "sort -n -k 3 -r" works as expected
>How-To-Repeat:
Create a file which sorts differently for alpha vs numeric sort, eg, 
  9
  10

Then

sort -k 1 -n ${file}

vs

sort -n -k 1 ${file}

>Fix:



Home | Main Index | Thread Index | Old Index