Subject: pkg/11964: a (shameful) shell redirection mistake
To: None <gnats-bugs@gnats.netbsd.org>
From: None <uebayasi@jp.netbsd.org>
List: netbsd-bugs
Date: 01/15/2001 08:15:16
>Number:         11964
>Category:       pkg
>Synopsis:       a (shameful) shell redirection mistake
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 15 08:15:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Masao Uebayashi
>Release:        1.5Q
>Organization:
Japan NetBSD Users Group
>Environment:
NetBSD takako 1.5Q NetBSD 1.5Q (TAKAKO) #0: Thu Jan 11 00:21:14 JST 2001     root@takako:/usr/src/sys/arch/i386/compile/TAKAKO i386
>Description:
lines like:
  ${cmd} 2>&1 > /dev/null

are apparently intended as:
  ${cmd} >/dev/null 2>&1
>How-To-Repeat:

>Fix:
diff -ru pkgsrc/japanese/skkserv.orig/files/skkserv.sh pkgsrc/japanese/skkserv/files/skkserv.sh
--- pkgsrc/japanese/skkserv.orig/files/skkserv.sh       Fri Oct 20 10:29:15 2000
+++ pkgsrc/japanese/skkserv/files/skkserv.sh    Tue Jan 16 01:11:58 2001
@@ -13,14 +13,14 @@
 
 case ${cmd} in
 start)
-       if [ -x ${command}  ]; then
+       if [ -x ${command} ]; then
                echo "Starting ${name}."
-               ${command} 2>&1 > /dev/null
+               ${command} >/dev/null 2>&1
        fi
        ;;
 *)
        if [ -x ${command} ]; then
-               ${command} ${cmd} 2>&1 > /dev/null
+               ${command} ${cmd} >/dev/null 2>&1
        fi
        ;;
 esac

>Release-Note:
>Audit-Trail:
>Unformatted: