[wellylug] Some help with grep

Rob Stockley wellylug at mowgli.net.nz
Sun Jun 20 09:35:07 NZST 2004


On Sunday 20 June 2004 09:30, Jamie Dobbs wrote:
> Sunday, June 20, 2004, 9:18:26 AM, you wrote:
>
> JD> Is there any way with grep that I can search for certain instances of
> JD> a string (in this case an email domain) but not include a certain
> JD> address.
>
> JD> ie. I want to find all occurances of @domain.co.nz in the file but have
> it ignore JD> any instances of this_address at domain.co.nz
>
> (but include all other email address in the domain in the search)

You could use a pipe.

$ grep "@domain.co.nz" somefile | grep -v "this_address at domain.co.nz"

I haven't tested this. You might need to escape some of the characters.
Rob




More information about the wellylug mailing list