[Wolves] Hello...

Andy Smith andy at strugglers.net
Wed Jun 17 15:27:03 UTC 2009


Hi DragonMaster,

On Mon, Jun 15, 2009 at 11:00:53AM +0100, DragonMaster wrote:
> > adams at selenium:~$ ps ax | grep apache | grep -v grep | awk {'print $1'}
> > 3933
> > 11133
> > 11135
> > 11136
> > 11138
> > 11139
> >
> > Awk uses tabs as field separators, so I'm telling it to pull out the
> > first one.
> 
> As a hint at the power of Awk, the above line can be shortened to be
>   ps ax | awk '/apache/ {print $1}'

"pgrep apache" is even shorter :)

Cheers,
Andy

-- 
http://bitfolk.com/ -- No-nonsense VPS hosting

"What should one say after making love?  ``Thank you'' seems too much.
 ``I'm sorry'' - somehow not enough." -- The League Against Tedium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/wolves/attachments/20090617/8c2fce62/attachment.pgp 


More information about the Wolves mailing list