#!/serveur/dp/bin/perl -w

# ------------------------------------------------------------
# kill des process correspondant au pattern
# ------------------------------------------------------------

use strict;

my $pattern = shift || die "usage : $0 <pattern>\n";

my @to_kill;
for(grep(/$pattern/,`ps -ef`)) {
	next if(/^\s*\S+\s+$$\s+/);
	push(@to_kill,$1) if(/^\s*\S+\s+(\d+)/);
}
if(@to_kill) {
	kill 9,@to_kill;
	print join(' ',@to_kill),"\n";
}

exit 0;

__END__
