Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!uxc.cso.uiuc.edu!tank!eecae!cps3xx!usenet
From: usenet@cps3xx.UUCP (Usenet file owner)
Newsgroups: comp.unix.questions
Subject: Re: Killing with awk and grep
Message-ID: <4128@cps3xx.UUCP>
Date: 11 Aug 89 03:34:20 GMT
References: <303@opus.NMSU.EDU>
Distribution: usa
Organization: Engineering, Michigan State U., E. Lansing MI
Lines: 14

in article <303@opus.NMSU.EDU>, tgardenh@nmsu.edu (Tricia Gardenhire) says:
> 
> Hi, I've been reading the man pages for awk, but they just aren't that
> helpful.  So here is my question:  I want to create a shell script
> that will look at ps -aux for a certain process called '-sleeper' and
> then kill it.  I've figured out how to search for it using grep and

ps -axe | grep pattern | grep -v grep | awk '{print "kill -9 " $1}' | sh


Robert Raisch - TechnoJunkie & UnixNut| UseNet: {uunet,mailrus}!frith!raisch
Network Software Group-301 Comp.Center| InterNet: raisch@frith.egr.msu.edu 
Michigan State University, E. Lansing | ICBMNet: 084 28 50 W / 42 43 29 N
----- The meek WILL inherit the Earth, (Some of us have other plans). ------