home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.shell:3709 comp.unix.questions:10561
- Path: sparky!uunet!olivea!decwrl!csus.edu!netcom.com!tunxis
- From: tunxis@netcom.com (Gary A. Gorgen)
- Newsgroups: comp.unix.shell,comp.unix.questions,netcom.general
- Subject: Re: Need Script To Kill Process Using Substring Of Application Name
- Message-ID: <rqhnklc.tunxis@netcom.com>
- Date: 31 Aug 92 14:14:26 GMT
- References: <x6gnwvc.westes@netcom.com>
- Organization: Tunxis Design Inc. (408-749-9463)
- Lines: 22
-
- 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
- >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.
- >
- >Thanks,
- >Will Estes Internet: westes@netcom.com
-
- You may have to change the ps & cut args to suit your needs.
-
- kill -9 `ps|grep $1|grep -v grep|cut -c1-6`
- --
- Gary A. Gorgen | "From ideas to PRODUCTS"
- tunxis@netcom.com | Tunxis Design Inc.
- | 422 S. Murphy, Sunnyvale Ca. (408) 749-9463
-