[HPADM] Re: script question - simplified - with file format

From: Balaji Nathan (balajinathan2003@yahoo.com)
Date: Wed Jun 09 2004 - 16:36:32 EDT


Hi admins,
I think I should simplify the question.
I have a configuration text file with the contents like below:
NETADDRESS=192.168.100.170
NETADDRESS=172.16.40.40

I would like to replace the ip addresses with the name. (DNS)
Please help.

Balaji Nathan <balajinathan2003@yahoo.com> wrote:
Hi Admins,
I need your help on the following.
I have a file (file1) with IP addresses (of the workstations)
The idea is to replace the ip addresses with names.
I am thinking:
a. Get a list of ip addresses from the file1 and call the new file as file2
   do a nslookup on the content of file2 and create a file called file3
    and some how I have to have two columns on file3 like
    
    192.168.30.100 workstation1
    I do not know how to create the above format file (with two columns)
 
b. Based on file3,I have to search and replace ip addresses with names on file1.
    In other words, using file3 contents, search a match for column1 (ip addresses) on file1 and replace with corresponding column 2 name.
Is this doable?
Please help.

---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger
                
---------------------------------
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:41 EDT