Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!uflorida!rex!ginosko!uunet!convex!tchrist@convex.UUCP From: tchrist@convex.UUCP (Tom Christiansen) Newsgroups: comp.unix.wizards Subject: Re: pid from process name Keywords: pid Message-ID: <1396@convex.UUCP> Date: 15 Jul 89 14:06:24 GMT References: <11723@drutx.ATT.COM> Sender: tchrist@convex.UUCP Reply-To: tchrist@convex.UUCP (Tom Christiansen) Distribution: comp Organization: CONVEX Technical Assistance Center, Richardson, TX Lines: 12 In article <11723@drutx.ATT.COM> blum@drutx.ATT.COM (Mark Blumhardt) writes: >Given a process name, how can I find its process id? It just isn't >obvious to me, other than a system call to grep thru the output of ps, >which I don't want to do. What is a "process name"? You mean u.u_comm (basically *argv)? That's hardy unique. If you have control over the process you're interested in have it write its pid somewhere. Otherwise you're going to have to do the 'ps|grep' thing unless you're up to a kernel dive, in which of course all things are possible but not all are expedient. :-) --tom