Subject: toolchain/33003: bin/ksh/siglist.sh uses sort +2n; doesn't bode well with the POSIX police
To: None <toolchain-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <cagney@gnu.org>
List: netbsd-bugs
Date: 03/05/2006 20:45:00
>Number:         33003
>Category:       toolchain
>Synopsis:       bin/ksh/siglist.sh uses sort +2n; doesn't bode well with the POSIX police
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 05 20:45:00 +0000 2006
>Originator:     cagney
>Release:        head
>Organization:
>Environment:
$ rpm -qf /bin/sort
coreutils-5.93-7.2

>Description:
Apparently, the good old, always worked, syntax of +2n for sort has gone out of favour (don't blame me :-).  Instead -k should be used.

>How-To-Repeat:
try to build ksh on a posix system
>Fix:
Index: bin/ksh/siglist.sh
===================================================================
RCS file: /cvsroot/src/bin/ksh/siglist.sh,v
retrieving revision 1.2
diff -p -u -r1.2 siglist.sh
--- bin/ksh/siglist.sh  12 Jan 1997 19:12:18 -0000      1.2
+++ bin/ksh/siglist.sh  5 Mar 2006 20:42:00 -0000
@@ -23,7 +23,7 @@ CPP="${1-cc -E}"
        { QwErTy SIG\1 , "\1", "\2" },\
 #endif/') > $in
 $CPP $in  > $out
-sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort +2n +0n |
+sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort -k 3n -k 1n |
     sed 's/^[0-9]* //' |
     awk 'BEGIN { last=0; nsigs=0; }
        {

might work