Processes in Linux from Python

Derek Martin code at pizzashack.org
Mon Sep 1 23:05:22 EDT 2008


On Mon, Sep 01, 2008 at 08:40:42AM +0200, Diez B. Roggisch wrote:
> Johny schrieb:
> >To get a number of  the http processes running on my Linux( Debia box)
> >I use
> >ps -ef | grep "[h]ttpd" | wc -l
[...]
> The shell does the exact same thing. And by the way: i think you miss a
> 
> grep -v grep

Indeed not.  The brackets around the 'h' (which make it a character
class, or range if you prefer) prevent the regex from matching itself.

-- 
Derek D. Martin
http://www.pizzashack.org/
GPG Key ID: 0x81CFE75D

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20080901/1c0fc2c4/attachment-0001.sig>


More information about the Python-list mailing list