Simple Script issue..?? - Thank you JAMES!

wayne waydavis at cox.net
Wed Dec 10 20:34:05 MST 2008


Going down the list of all your replies, James' was the first that did 
exactly what I was looking for.  THANK YOU TO ALL for your help.  :-)




James Mcphee wrote:
> kill won't take a list from stdout, but if you | xargs kill, then 
> it'll happily do it.
>
> ps -A | grep $1 | cut -c1-5 | grep -o [0-9]* | xargs kill
> or kill -9
>
> On Wed, Dec 10, 2008 at 6:54 PM, Bryan O'Neal 
> <boneal at cornerstonehome.com <mailto:boneal at cornerstonehome.com>> wrote:
>
>     Change the direction of the kill input.  It may be simpler to use
>     pkill.
>     Maybe just change up the script to take in the input as a var and
>     then pkill
>     -f "$var"
>
>     -----Original Message-----
>     From: plug-discuss-bounces at lists.plug.phoenix.az.us
>     <mailto:plug-discuss-bounces at lists.plug.phoenix.az.us>
>     [mailto:plug-discuss-bounces at lists.plug.phoenix.az.us
>     <mailto:plug-discuss-bounces at lists.plug.phoenix.az.us>] On Behalf
>     Of wayne
>     Sent: Wednesday, December 10, 2008 6:43 PM
>     To: Main PLUG discussion list
>     Subject: Simple Script issue..??
>
>     ps -A | grep $1 | cut -c1-5 | grep -o [0123456789]* | kill
>
>
>     WILL NOT WORK.
>
>     I want to run the above script "whack" like this:   whack  kicker
>     which should kill the process "kicker"
>      But it chokes at the "kill" part and I do not know what I'm
>     doing.....
>     and doing wrong  :-)
>
>     Anybody?
>     ---------------------------------------------------
>     PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
>     <mailto:PLUG-discuss at lists.plug.phoenix.az.us>
>     To subscribe, unsubscribe, or to change your mail settings:
>     http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
>     ---------------------------------------------------
>     PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
>     <mailto:PLUG-discuss at lists.plug.phoenix.az.us>
>     To subscribe, unsubscribe, or to change your mail settings:
>     http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
>
>
>
> -- 
> James McPhee
> jmcphe at gmail.com <mailto:jmcphe at gmail.com>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20081210/2b334d73/attachment.htm 


More information about the PLUG-discuss mailing list