[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tr: Problem with grep v2.5.1
From: |
Micah Cowan |
Subject: |
Re: Tr: Problem with grep v2.5.1 |
Date: |
Fri, 18 May 2007 14:30:32 -0700 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070403) |
Paul Jarc wrote:
> Simon Nieux <address@hidden> wrote:
>>> grep -B 3 "\.\.\.[0-9]\{3\}" wget.log | grep -v -B 3 "\.\.\.200"
>
> That means that th second grep will print every line that doesn't
> match "\.\.\.200", and the three lines preceding each of those lines.
> To get what you want using grep, you'd need a different pattern in
> place of "\.\.\.[0-9]\{3\}" that inherently excludes "...200" without
> using -v:
> grep -E -B 3 '\.\.\.([013-9][0-9]{2}|2[1-9][0-9]|20[1-9])'
You're using -E, so it should be "..." rather than "\.\.\."
Won't this approach have /exactly/ the same behavior?
--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
Re: Tr: Problem with grep v2.5.1, Andreas Schwab, 2007/05/18