Unix Programming - Re: How to write a script to kill more than one process matching

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > August 2007 > Re: How to write a script to kill more than one process matching





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: How to write a script to kill more than one process matching
Eric Sosman

2007-08-23, 1:27 pm

mullin wrote On 08/23/07 08:23,:
> Let's say that have a program that will be run more than one instance
> on Solaris, how can I use "kill" command to delete them all if I'm
> using bash shell.
>
> If I run this command:
> /usr/ucb/ps -auxwww | grep app_name | cut -f1-3 -d ' '
>
> it will return something like this:
> userA: 12345
> userA: 12340
>
> where userA is the userid running the program and 2nd one is the PID.
>
> But, how can I write the sh script to kill them all?


Use "man pkill" and write a very short script.

--
Eric.Sosman@sun.com
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com