Thread
:
Find pattern in a file and erase it
View Single Post
#
4
(View Single Post)
24th June 2008
ephemera
Knuth's homeboy
Join Date: Apr 2008
Posts: 537
sed -i.bak '/ptrisn.com/{N;N;d;}' named.conf
or
perl -i.bak -pe 'if(/ptrisn.com/){<>;<>;$_=undef}' named.conf
btw, lvlamb's sed command is pretty neat.
Last edited by ephemera; 25th June 2008 at
12:19 AM
.
ephemera
View Public Profile
Find all posts by ephemera