If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > need a script to add a line in file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-20-07, 10:08
dnyan dnyan is offline
Registered User
 
Join Date: Apr 2007
Posts: 2
Cool need a script to add a line in file

please help me . i am new to shell scripting.
i have to files . one is named.conf and another is .db file i.e for example named.conf file
contains the line zone "xyz.com" { type master; file "/var/named/xyz.com.db"; };
there are so many such zone records are present in named.conf file. and second file is .db file . this file contains all .db files for example 1> xyz.com.db 2> pqr.co.in.db
there r so many such .db files. i want a script which will check .db file in named.conf , if it
will find entry in named.conf file then do nothing , but if there is no entry then add a zone record for that perticular .db file at the bottom of named.conf file. for example i want to search a .db file named as xyz.com.db in named.conf file but for that file zone record is already exist. i.e zone "xyz.com" { type master; file "/var/named/xyz.com.db"; }; , if record
is not exist then add it at the bottom of named.conf file. i want to use this script for multiple
.db files .
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On