Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/etc/MAKEDEV.tmpl,v rcsdiff: /ftp/cvs/cvsroot/src/etc/MAKEDEV.tmpl,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.104 retrieving revision 1.105 diff -u -p -r1.104 -r1.105 --- src/etc/MAKEDEV.tmpl 2008/04/09 20:19:15 1.104 +++ src/etc/MAKEDEV.tmpl 2008/04/15 09:52:41 1.105 @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: MAKEDEV.tmpl,v 1.104 2008/04/09 20:19:15 apb Exp $ +# $NetBSD: MAKEDEV.tmpl,v 1.105 2008/04/15 09:52:41 apb Exp $ # # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc. # All rights reserved. @@ -361,8 +361,13 @@ linecount() # nooutput -12 cmd [args...] # run a command with stdout and/or stderr ignored. -# "nooutput -2 cmd" is like "cmd 2>/dev/null", -# except it should work even if /dev/null doesn't [yet] exist. +# "nooutput -1 cmd" is like "cmd >/dev/null"; +# "nooutput -2 cmd" is like "{ cmd ; } 2>/dev/null"; +# "nooutput -12 cmd" is like "{ cmd ; } >/dev/null 2>&1"; +# except they should work even if /dev/null doesn't [yet] exist. +# +# The "{...}" wrapper used in cases where stderr is redirected +# serves to capture shell error messages such as "cmd: not found". # nooutput() { @@ -370,8 +375,8 @@ nooutput() local junk case "$flags" in "-1") junk="$( "$@" )" ;; - "-2") exec 4>&1 ; junk="$( "$@" 2>&1 1>&4 )" ; exec 4>&- ;; - "-12") junk="$( "$@" 2>&1 )" ;; + "-2") exec 4>&1 ; junk="$( { "$@" ; } 2>&1 1>&4 )" ; exec 4>&- ;; + "-12") junk="$( { "$@" ; } 2>&1 )" ;; *) warn "Incorrect use of nooutput" ;; esac }