<!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=933022515-15062005><FONT face=Arial 
color=#0000ff size=2>I use</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2>ps -ef | awk '{print $2}' to get the 
pid</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2>kill -9 `<SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2>ps -efw | awk '{print 
$2}'`</FONT></SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2><SPAN 
class=933022515-15062005></SPAN></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2><SPAN class=933022515-15062005>would do 
it.</SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2><SPAN 
class=933022515-15062005></SPAN></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=933022515-15062005><FONT face=Arial 
color=#0000ff size=2><SPAN class=933022515-15062005>or ps aux | awk '{print $2}' 
if you want to use aux.</SPAN></FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=933022515-15062005></SPAN><FONT face=Arial><FONT 
color=#0000ff><FONT size=2>G<SPAN 
class=933022515-15062005>raham</SPAN></FONT></FONT></FONT><BR></DIV>
<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>