Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Dec 2000 03:50:21 -0600 (CST)
From:      David Talkington <dtalk@prairienet.org>
To:        Dave Wilson <davew@sai.co.za>
Cc:        <freebsd-isp@FreeBSD.ORG>
Subject:   Re: Off topic - shell skills
Message-ID:  <Pine.LNX.4.30.0012180347360.933-100000@sherman.spotnet.org>
In-Reply-To: <NEBBJFIIGKGLPEBIJACLKEIJCJAA.davew@sai.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help


Dave Wilson wrote:
>
>I have about 600 DNS zones on my DNS server, now because we are changing IP
>addresses on our mail server most of those zones' MX/A records will need
>updating.
>How do I write a shell script that will change:
>
>mail	IN	A  10.1.1.58
>
>to:
>
>mail 	IN	A  10.0.0.1
>
>I need this script to parse through each zone, so when it finds "10.1.1.58"
>in a zone it will change the "10.1.1.58" to "10.0.0.1".
>Please help if you can.

Perl's File::find module is great for recursive search and replace.
If you don't find an easier way, I have a script that I wrote for
replacing lazy PHP <? tags with proper <?php tags in a whole tree;
could be easily modified.

-d

-- 
David Talkington
Community Networking Initiative
dtalk@prairienet.org
217-244-1962

PGP key: http://www.prairienet.org/~dtalk/dt000823.asc




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.30.0012180347360.933-100000>