From owner-freebsd-questions Tue Apr 20 14:22:19 1999 Delivered-To: freebsd-questions@freebsd.org Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.144.32]) by hub.freebsd.org (Postfix) with ESMTP id CD01314CB1 for ; Tue, 20 Apr 1999 14:22:14 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.8.8/8.8.8) with ESMTP id OAA24974; Tue, 20 Apr 1999 14:19:36 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Date: Tue, 20 Apr 1999 14:19:36 -0700 (PDT) From: Doug White To: Hugh Blandford Cc: questions@FreeBSD.ORG Subject: Re: OFF TOPIC change a number of DNS SOAs In-Reply-To: <3.0.6.32.19990420151157.00800100@mail.island.net.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 20 Apr 1999, Hugh Blandford wrote: > Hi All, > > have had to go through and change all my mail secondary info in my zone > files. Someone was kind enough to give me a PERL script to do a search and > replace. However, I was wondering if there was a command that I could run > that would go through and change all the serial numbers (which vary wildly) > to a new one. It would basically need to be run against all the files in a > particular directory. > > eg: 1998072502 to 1999041601 It's all about regex's. If all of them have 'serial' somewhere on the line, it's an easy match. perl -pi.old -e 's/\s+\d+.*serial$/1999041601 \; Serial/i' files ... I just did this two weeks ago, as you might guess :) Doug White Internet: dwhite@resnet.uoregon.edu | FreeBSD: The Power to Serve http://gladstone.uoregon.edu/~dwhite | www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message