<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=828453215-15062005><FONT face=Arial 
color=#0000ff size=2>Oops forgot the grep bit.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=828453215-15062005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=828453215-15062005><FONT face=Arial 
color=#0000ff size=2>kill -9 `ps -ef | grep "whatever" | awk '{print 
$2}'`</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=828453215-15062005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=828453215-15062005><FONT face=Arial 
color=#0000ff size=2>Graham</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> whitebox-users-bounces@beau.org 
[mailto:whitebox-users-bounces@beau.org] <B>On Behalf Of </B>Andrew 
Vong<BR><B>Sent:</B> 15 June 2005 15:56<BR><B>To:</B> 
whitebox-users@beau.org<BR><B>Subject:</B> [WBEL-users] Another Shell Scripting 
Question<BR></FONT><BR></DIV>
<DIV></DIV><BR>Dear Gurus,<BR><BR>Thanks for all who responded to my previous 
question. It worked great! <BR><BR>I am now trying to perform a "ps aux | grep 
"some regular expression" | cut -f 2 -d ......"<BR><BR>I seem to be having 2 
problems. <BR><BR>1) What delimiter should I define for cut? I've tried " " 
(space) but that does not work.<BR>2) I usually get 2 processes listed. The 
actualy one I'm looking for and the line I just executed. How can I exclude the 
2nd process which also contains the same "grep <I>regular expression</I>" 
?<BR><BR>The above is part of a longer one-liner command I'm trying to 
construct. I basically want to kill a specific process and I just want to obtain 
the PID for it. So, it may end up looking like this??<BR><BR>$ ps aux | grep 
"some regular expression" | cut -f 2 -d ...... | xargs kill -9<BR><BR>Or 
something along those lines... <BR><BR>Hope someone out there can help me. 
<BR><BR>Thanks again. :)<BR><BR>Best Regards,<BR>Andrew<BR><BR></BODY></HTML>