Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2002 10:00:37 -0800
From:      "Crist J. Clark" <cristjc@earthlink.net>
To:        Eric Six <erics@sirsi.com>
Cc:        "'questions@FreeBSD.ORG'" <questions@FreeBSD.ORG>
Subject:   Re: Perl question...
Message-ID:  <20020201100036.Q152@gohan.cjclark.org>
In-Reply-To: <DC32C8CEB3F8D311B6B5009027DE5AD503D207F8@stlmail.dra.com>; from erics@sirsi.com on Fri, Feb 01, 2002 at 09:55:19AM -0600
References:  <DC32C8CEB3F8D311B6B5009027DE5AD503D207F8@stlmail.dra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020201100036.Q152>