[WBEL-users] Another Shell Scripting Question
Johnny Hughes
mailing-lists at hughesjr.com
Wed Jun 15 10:08:13 CDT 2005
On Wed, 2005-06-15 at 22:55 +0800, Andrew Vong wrote:
>
> Dear Gurus,
>
> Thanks for all who responded to my previous question. It worked
> great!
>
> I am now trying to perform a "ps aux | grep "some regular expression"
> | cut -f 2 -d ......"
>
> I seem to be having 2 problems.
>
> 1) What delimiter should I define for cut? I've tried " " (space) but
> that does not work.
> 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 regular expression" ?
other_stuff | grep -v grep
>
> 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??
>
> $ ps aux | grep "some regular expression" | cut -f 2 -d ...... | xargs
> kill -9
>
> Or something along those lines...
>
> Hope someone out there can help me.
>
> Thanks again. :)
>
> Best Regards,
> Andrew
>
> _______________________________________________
> Whitebox-users mailing list
> Whitebox-users at beau.org
> http://beau.org/mailman/listinfo/whitebox-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://beau.org/pipermail/whitebox-users/attachments/20050615/10b9db23/attachment.bin
More information about the Whitebox-users
mailing list