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
NetBSD 7.0_STABLE NetBSD 7.0_STABLE (GENERIC.201610051330Z) amd64

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
Create a file which sorts differently for alpha vs numeric sort, eg, 


sort -k 1 -n ${file}


sort -n -k 1 ${file}


Home | Main Index | Thread Index | Old Index