[SunHELP] Speaking of killing processes....

Vinay Bharel sunhelp at sunhelp.org
Fri Feb 23 16:30:44 CST 2001


ps -ef | grep datd | awk '{print $2}' | xargs kill -9

- Vinay Bharel <vinay at bharel.com>

On 23 Feb 2001, David Bishop wrote:

> I need to have a script go out and kill a group of processes, all with the
> same binary name.  I've figured out how to get a list of the process ids (ps
> -ax | grep datd | cut -f1 -d" ") but don't know enough about shell
> programming to figure out how to stuff that into an array, then iterate
> through that array doing a kill -9.  Any ideas? I know this should be a quick
> 2 or 3 liner, I'm just braindead on a Friday afternoon :-)  And yes, this is
> all standard bourne shell on a Solaris 7 Ultra60.  Not that is should matter
> to the shell...
> 
> 
> TIA,
> 
> D.A.Bishop
> 
> P.S. Be nice to the newbie *grin*
> _______________________________________________
> SunHELP maillist  -  SunHELP at sunhelp.org
> http://www.sunhelp.org/mailman/listinfo/sunhelp
> 




More information about the SunHELP mailing list