home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.shell:3704 comp.unix.questions:10551
- Path: sparky!uunet!crdgw1!rdsunx.crd.ge.com!rdsunx!montnaro
- From: montnaro@ausable.crd.ge.com (Skip Montanaro)
- Newsgroups: comp.unix.shell,comp.unix.questions,netcom.general
- Subject: Re: Need Script To Kill Process Using Substring Of Application Name
- Message-ID: <MONTNARO.92Aug30221640@ausable.crd.ge.com>
- Date: 31 Aug 92 03:16:40 GMT
- References: <x6gnwvc.westes@netcom.com>
- Sender: usenet@crd.ge.com (Required for NNTP)
- Reply-To: montanaro@crd.ge.com (Skip Montanaro)
- Organization: GE Corporate Research & Development, Schenectady, NY
- Lines: 18
- In-Reply-To: westes@netcom.com's message of 30 Aug 92 23:07:51 GMT
- Nntp-Posting-Host: ausable.crd.ge.com
-
- 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?
-
- Here's a script that might fit the bill:
-
- #!/bin/sh
-
- ps -auxww | egrep $1 | grep -v egrep | awk '{print $2}' | xargs kill
-
- Call it slay?
-
- Of course, on a SysV machine it will have to be "ps -efl" and "{print $3}".
-
- --
- Skip (montanaro@crd.ge.com)
-