1758660 Members
2430 Online
108874 Solutions
New Discussion юеВ

script help ~

 
mw_4
Frequent Advisor

script help ~

Hi all
who could you give me clear answer..?

see attached file..
thanks
any tips are helpful
Step by step
3 REPLIES 3
Jordan Bean
Honored Contributor

Re: script help ~

Do you want to generate 8000 lines of hostnames that resolve to the same IP? This can be done using a wildcard:

* IN A 10.10.10.10

Or are you looking for a way to translate /etc/hosts to the appropriate `named` zone files? I'm not at work so I don't have access to the PERL script I've created to handle our specific needs. I'll get that posted if you'd like to see it.

Ralph Grothe
Honored Contributor

Re: script help ~

Sorry,

if you expect a clear answer, would you mind to utter your question clearly? ;-)

I cannot recapitulate what you're trying to achieve.
Your attachment looks like a DNS zone file to me.
Do you want to automatically create/modify such files by a script?
Madness, thy name is system administration
Steve Post
Trusted Contributor

Re: script help ~

You have a file with
zzz
yyy
xxx
Let's call it file1.

you want "IN A 10.10.10.10" added to each line?

Ok.
Using a script.....
#!/bin/ksh
exec 3while read LINE 0<&3
do
echo $LINE "IN A 10.10.10.10" > file2
done
3<&-

Using vi.....
vi file1
:%s/$/IN A 10.10.10.10/
:wq!

there you go.
Don't know what you WANT it for. But at least you now have a way to append that stuff in a file.
Steve