Simple Script issue..??

JD Austin jd at twingeckos.com
Wed Dec 10 19:42:53 MST 2008


There are a few ways to skin the cat...
I always use awk to print out the command I want to run and then pipe to
bash to execute it.
It lets me see what it's going to do before it does it.
IE:
ps -A | grep $1 | cut -c1-5 | grep -o [0123456789]* | awk '{print "kill
"$1}'
then if it's what you want:
ps -A | grep $1 | cut -c1-5 | grep -o [0123456789]* | awk '{print "kill
"$1}'  | bash
On Wed, Dec 10, 2008 at 6:42 PM, wayne <waydavis at cox.net> wrote:

> 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
> 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/0820e866/attachment.htm 


More information about the PLUG-discuss mailing list