home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.shell:3708 comp.unix.questions:10560
- Path: sparky!uunet!cis.ohio-state.edu!rutgers!cmcl2!panix!alexis
- From: alexis@panix.com (Alexis Rosen)
- Newsgroups: comp.unix.shell,comp.unix.questions,netcom.general
- Subject: Re: Need Script To Kill Process Using Substring Of Application Name
- Message-ID: <1992Aug31.113416.8536@panix.com>
- Date: 31 Aug 92 11:34:16 GMT
- References: <x6gnwvc.westes@netcom.com>
- Organization: PANIX Public Access Unix, NYC
- Lines: 23
-
- 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
- >like:
-
- > ps guaxww | grep "some_substring"
-
- >then it would exclude the line that contained the grep command, locate
- >the PID of the remaining processes, and kill each one. Please post the
- >script for others to see if its short enough.
-
- Here's one which I used for wasting hung gettys.
- kill `ps -furoot | awk '/getty/ && !/ps/ {printf "%s ",$2}'`
-
- This is SysV, so you'll need to change the ps arguments and maybe the awk
- $2 to $something-else.
-
- --
- Alexis Rosen Owner/Sysadmin,
- PANIX Public Access Unix & Internet, NYC.
- alexis@panix.com
- {uupsi,cmcl2}!panix!alexis
-