From owner-freebsd-isp Mon Dec 18 1:50:41 2000 From owner-freebsd-isp@FreeBSD.ORG Mon Dec 18 01:50:40 2000 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from firefly.prairienet.org (firefly.prairienet.org [192.17.3.3]) by hub.freebsd.org (Postfix) with ESMTP id 4337437B400 for ; Mon, 18 Dec 2000 01:50:39 -0800 (PST) Received: from sherman.spotnet.org (slip-84.prairienet.org [192.17.3.104]) by firefly.prairienet.org (8.9.3/8.9.3) with ESMTP id DAA27023; Mon, 18 Dec 2000 03:50:25 -0600 (CST) Date: Mon, 18 Dec 2000 03:50:21 -0600 (CST) From: David Talkington X-Sender: To: Dave Wilson Cc: Subject: Re: Off topic - shell skills In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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