[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in grep when using both --after-context and --invert-match
From: |
Paul Jarc |
Subject: |
Re: Bug in grep when using both --after-context and --invert-match |
Date: |
Fri, 04 Nov 2005 11:30:27 -0500 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.4 (gnu/linux) |
Oni Studio <address@hidden> wrote:
> Logically, i tried:
> grep -v -A4 'zone "domain.com' /etc/bind/zones > /etc/bind/zones.new
>
> This did not produce the desired effect.
Right. This gives you eery line that does not match your pattern,
along with the following four lines. Here's one way to get what you
want (untested):
grep -A4 'zone "domain.com' /etc/bind/zones |
diff - /etc/bind/zones |
sed '/^> /!d;s/^> //'
paul