From owner-freebsd-questions Fri Feb 1 10:13:51 2002 Delivered-To: freebsd-questions@freebsd.org Received: from avocet.prod.itd.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by hub.freebsd.org (Postfix) with ESMTP id B362E37B41E for ; Fri, 1 Feb 2002 10:13:41 -0800 (PST) Received: from user-2ivfov0.dialup.mindspring.com ([165.247.227.224] helo=gohan.cjclark.org) by avocet.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16WiBv-0005BU-00; Fri, 01 Feb 2002 10:13:40 -0800 Received: (from cjc@localhost) by gohan.cjclark.org (8.11.6/8.11.1) id g11I0bf70665; Fri, 1 Feb 2002 10:00:37 -0800 (PST) (envelope-from cjc) Date: Fri, 1 Feb 2002 10:00:37 -0800 From: "Crist J. Clark" To: Eric Six Cc: "'questions@FreeBSD.ORG'" Subject: Re: Perl question... Message-ID: <20020201100036.Q152@gohan.cjclark.org> Reply-To: cjclark@alum.mit.edu References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from erics@sirsi.com on Fri, Feb 01, 2002 at 09:55:19AM -0600 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Feb 01, 2002 at 09:55:19AM -0600, Eric Six wrote: > > > Though this doesn't pertain to BSD, except for the fact I am running this on > freebsd ;), I wanted to run it by the list as I have gotten wonderful > answers before! > > I have about 400 primary and 300 secondary DNS records that I have migrated > from a bind4 server. I need to add a '$TTL value;' to the first line of all > my zone files... > > I have found ways to append lines to the file, but not to create a new one > at the very beginning. Also, any ideas on how to automate doing this to all > the files in each dir? ed(1) man. man ed. for FILE in $DIR; do ed $DIR/$FILE <<"EOF" 1i $TTL value . wq EOF done -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message