Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2001 16:47:17 -0600
From:      Chris Wasser <cwasser@v-wave.com>
To:        arch@freebsd.org
Subject:   netbsd rc.subr diff #2
Message-ID:  <20010617164716.H582@skunkworks.arpa.mil>

next in thread | raw e-mail | index | archive | help

--UHN/qo2QbUvPLonB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

 I hate to spam the list with repetitious emails; attached is my current
running diff against /etc/rc.subr which now implements the change
suggested by Kelly Yancey which removes the header from the ps output,
thus removing the check for it.


--UHN/qo2QbUvPLonB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rc.subr.diff"

--- rc.subr	Sun Jun 17 14:14:16 2001
+++ rc.subr.new	Sun Jun 17 16:40:12 2001
@@ -116,12 +116,10 @@
 		return
 	fi
 	_procnamebn=${_procname##*/}
-	ps -p $_pid -o 'pid,command' | while read _npid _arg0 _argv; do
-		if [ "$_npid" = "PID" ]; then
-			continue
-		fi
+	ps -p $_pid -o 'pid,command' | tail +2 | sort +1 | while read _npid _arg0 _argv; do
 		if [   "$_arg0" = "$_procname" \
 		    -o "$_arg0" = "$_procnamebn" \
+		    -o "$_arg0" = "/${_procnamebn}" \
 		    -o "$_arg0" = "${_procnamebn}:" \
 		    -o "$_arg0" = "(${_procnamebn})" ]; then
 			echo $_npid
@@ -143,12 +141,10 @@
 	fi
 	_procnamebn=${_procname##*/}
 	_pref=
-	ps -ax -o 'pid,command' | while read _npid _arg0 _argv; do
-		if [ "$_npid" = "PID" ]; then
-			continue
-		fi
+	ps -ax -o 'pid,command' | tail +2 | sort +1 | while read _npid _arg0 _argv; do
 		if [   "$_arg0" = "$_procname" \
 		    -o "$_arg0" = "$_procnamebn" \
+		    -o "$_arg0" = "/${_procnamebn}" \
 		    -o "$_arg0" = "${_procnamebn}:" \
 		    -o "$_arg0" = "(${_procnamebn})" ]; then
 			echo -n "$_pref$_npid"

--UHN/qo2QbUvPLonB--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010617164716.H582>