Regex, but without
C M Reinehr
cmr at amsent.com
Tue Jan 29 07:33:29 PST 2008
On Tuesday 29 January 2008 08:37, Michael Hipp wrote:
> I'm not a very deep expert on regular expressions, and I can't seem to
> find the answer in my trusty copy of 'Mastering Regular Expressions'.
>
> I want to find all instances of 'python' running for a given user so I
> do this:
>
> $ ps -f -U michael | grep python
> michael 24638 24618 0 08:31 pts/0 00:00:00 python
> michael 24665 24643 0 08:32 pts/1 00:00:00 grep python
>
> But I get that hanger-on in my grep command. I can easily get rid of
> that second line by stringing another grep after it, but there ought to
> be a way to do it with only one regex.
>
> So I need a regex that will find every line with 'python' on it but not
> 'grep'.
>
> Any help?
>
> Michael
I would consider doing this with a simple 'awk' script.
cmr
--
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC
More information about the Linux-users
mailing list