Subject: Re: kill in bash script
To: David Laight <david@l8s.co.uk>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-help
Date: 11/13/2002 22:44:30
On Wed, Nov 13, 2002 at 09:21:46PM +0000, David Laight wrote:
> > 
> > for i in `ps a | grep whateverprogram | awk '{print $1}'`; do kill
> > -WHATEVERSIGNAL $i; done
> 
> Mmm.. this construct is all too common, especially in stop scripts
> for unixware and solaris.  It has one major bug in that the

This is why I prefer to use:
ps a | awk '$5 == "name_or_path_to_kill" {print $1}'

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 23 ans d'experience feront toujours la difference
--