home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.shell:3707 comp.unix.questions:10555
- Newsgroups: comp.unix.shell,comp.unix.questions,netcom.general
- Path: sparky!uunet!usc!sdd.hp.com!news.cs.indiana.edu!syscon!gator!dlpinc00!dlparker
- From: dlparker@dlpinc00.rn.com (David L. Parker)
- Subject: Re: Need Script To Kill Process Using Substring Of Application Name
- Message-ID: <1992Aug31.095604.488@dlpinc00.rn.com>
- Organization: Automated Data Management Services
- References: <x6gnwvc.westes@netcom.com>
- Date: Mon, 31 Aug 1992 09:56:04 GMT
- Lines: 16
-
- In article <x6gnwvc.westes@netcom.com> westes@netcom.com (Will Estes) writes:
- >Does anyone have a script that they could send to me that will take as
- >its input some substring and then kill any process you own that has that
- >substring in its application name? So the script would do something
-
- To kill a process named upsd:
-
- pid=`/bin/ps -e | grep upsd | sed -e 's/^ *//' -e 's/ .*//'`
- if [ "${pid}" != "" ]
- then
- /bin/kill -9 ${pid}
- fi
- --
- Dave Parker
- Automated Data Management Services, Pleasant Hill, MO 64080-1331
- (816) 987-5167/5218 voice/fax
-