Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: AWKing for PIDs (was Re: NetBSD style rc.d scripts?)

From: Christopher Linn <celinn(at)mtu.edu>
Date: Fri Jan 31 2003 - 13:27:27 EST

On Fri, Jan 31, 2003 at 01:07:09PM -0500, Michael Erdely wrote:
> I've used this in my scripts in the past... it seems to work:

i like:

PID=`ps -axo pid,ppid,command | egrep "[h]ttpd" \

        | awk '{if ($2 == "1") print $1}' -`

> Basically, you're looking for only the instance of a command where the

yes.

chris

-- 
Christopher Linn, (celinn at mtu.edu) | By no means shall either the CEC
Staff System Administrator            | or MTU be held in any way liable
  Center for Experimental Computation | for any opinions or conjecture I
    Michigan Technological University | hold to or imply to hold herein.
Received on Fri Jan 31 13:32:40 2003
Do you need help?X

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:48:29 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library