[plug] Small problem with cut

J Michael Gilks mike at gilks1.com
Sun May 16 10:43:04 WST 2004


Ah yes, dear old awk.
I do tend to focus on what I am using at the moment and forget all the easy 
stuff.
Must broaden my horizons.

Love
Mike.

On Sun, 16 May 2004 08:53 am, James Devenish wrote:
> Hi,
>
> In message <200405160348.08187.mike at gilks1.com>
>
> on Sun, May 16, 2004 at 03:48:08AM +0800, J Michael Gilks wrote:
> > ps aux | grep "kdeinit: konqueror -session" | cut -f 6 -d " "
> > should give the result you are after.
>
> I suggest that these are more robust (unless I've made typos):
>
> ps auxw | fgrep 'kdeinit: konqueror -session' | awk '{print$2}'
>
> (I.e. use awk instead of cut.)
>
> pgrep -f konqueror
>
> (This is a frequently asked question on this list.)
>
> The only thing to watch out for in all the above cases is whether you
> are matching processes that belong to users other than yourself. This
> may or may not be relevant to your situation, and probably has no
> practical impact unless you strictly need only a single PID to be
> returned.
>
>
> _______________________________________________
> PLUG discussion list: plug at plug.linux.org.au
> http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au



More information about the plug mailing list