#!/usr/bin/perl my $prog = shift || die "no args!\n"; my @pids; open PH, "ps ax|" or die $!; while( <PH> ){ /$prog/ || next; /^\s*(\d+)/ and push @pids, $1 } # Updated (thanks to merlyn): kill 15, $_ for@pids; sleep 5; kill 2, $_ for@pids; sleep 5; kill 9, $_ for@pids;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Process termination
by merlyn (Sage) on Aug 13, 2005 at 14:00 UTC | |
|
Re: Process termination
by tlm (Prior) on Aug 13, 2005 at 15:44 UTC | |
|
Re: Process termination
by sh1tn (Priest) on Aug 13, 2005 at 23:04 UTC | |
by Happy-the-monk (Canon) on Aug 14, 2005 at 11:58 UTC | |
by sh1tn (Priest) on Aug 14, 2005 at 12:13 UTC | |
|
Re: Process termination
by aplonis (Pilgrim) on Aug 21, 2005 at 02:47 UTC | |
|
Re: Process termination
by jfroebe (Parson) on Sep 10, 2005 at 15:23 UTC |