Re: Simple Script issue..??

2008-12-10 Thread [EMAIL PROTECTED]
kill `ps aux|grep -v grep|grep kicker|cut -b10-15`
WHAM!
Gone...   :)
Enrique 

 

wayne writes: 

 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@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@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


RE: Simple Script issue..??

2008-12-10 Thread Lisa Kachold

Just use:

#pkill $processname

Reference: http://en.wikipedia.org/wiki/Pkill

www.Obnosis.com |  http://en.wiktionary.org/wiki/Citations:obnosis |  
(503)754-4452
Catch the January PLUG HackFest!   Kristy Westphal, CSO for the AZ Department 
of Economic
Security will provide a one hour
presentation on forensics 1/10/09 Noon at UAT.edu.


 Date: Wed, 10 Dec 2008 18:42:54 -0700
 From: [EMAIL PROTECTED]
 To: plug-discuss@lists.plug.phoenix.az.us
 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@lists.plug.phoenix.az.us
 To subscribe, unsubscribe, or to change your mail settings:
 http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

_
Send e-mail faster without improving your typing skills.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

RE: Simple Script issue..??

2008-12-10 Thread Bryan O'Neal
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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 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@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@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


Re: Simple Script issue..??

2008-12-10 Thread James Mcphee
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 [EMAIL PROTECTED]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: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] 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@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@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
[EMAIL PROTECTED]
---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

Re: Simple Script issue..??

2008-12-10 Thread JD Austin
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 [EMAIL PROTECTED] 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@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@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

Re: Simple Script issue..??

2008-12-10 Thread David

On Dec 10, 2008, at 6:42 PM, wayne 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?
 ---

for i in `ps aux | grep $1 | awk '{ print $2 }'`; do kill $i; done

I have to use this all the time on errant oracle processes :)
David

I find your lack of faith disturbing.
--Darth Vader



---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


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

2008-12-10 Thread wayne
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 
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]] 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@lists.plug.phoenix.az.us
mailto:PLUG-discuss@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@lists.plug.phoenix.az.us
mailto:PLUG-discuss@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
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]


---
PLUG-discuss mailing list - PLUG-discuss@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@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss