Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

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

From: Christoph Moench-Tegeder <cmt(at)rz.uni-karlsruhe.de>
Date: Fri Jan 31 2003 - 13:25:03 EST

## Michael Erdely (mike@erdelynet.com):

> command = "httpd"

For easy use:
pidof() {

	ps -axo pid,ppid,command | awk "\$3==\"$1\" && \$2==\"1\" {print \$1}"
	}

in your .profile. Saves two processes, too (why run grep if you have awk already running?)

Regards,
cmt

-- 
Spare Space
Received on Fri Jan 31 13:27:24 2003

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