hi jason,
i'd recommend sed for this:
sed -e '/^mx/d' < mxremove.txt > mxremoved.txt
mxremove.txt:
line 1
line 2
mx
mx0
line 5
line 6
after sed
mxremoved.txt:
line 1
line 2
line 5
line 6
make sense? of course i'd put this sed line in a shell script and have it
execute on all files and output to the filename.new via a loop... etc...
i'm sure there are handful of other ways to do the same thing.
hope this helps.
cheers,
clay
> I can't figure out how to do this. I've tried to cobble something
> together from examples I've googled but I keep running into errors.
> Probably a simple misunderstanding.
>
> I've got 323 zone files of the style: sub.domain.tld.db
>
> Each file has two lines, one after the other, that look like this (among
> many other lines):
>
> <snip>
> mx 600 IN A 4.79.140.190
> mx0 600 IN A 4.79.140.190
> </snip>
>
> where the field separators are all tabs.
>
> I need to delete the first of these two lines in all the zone files.
>
> (Note that I do NOT need to change the serial numbers; I've got a
> program that does that. I only need to remove the top line of this
> pair of lines wherever it exists in the zone file.
>
> There is NEVER the first line without the second.
>
> Can someone help me with a simple script?
>
> Thanks.
>
> Jeff
> --
> Jeff Lasman, Nobaloney Internet Services
> 1254 So Waterman Ave., Suite 50, San Bernardino, CA 92408
> Our blists address used on lists is for list email only
> Phone +1 909 266-9209, or see: "http://www.nobaloney.net/contactus.html"
>
|