[HPADM] ip to hosts file merging

From: Rasheed Tamton (Contractor) (Rasheedt@stc.com.sa)
Date: Sat Jul 13 2002 - 07:50:00 EDT


Hi admins,

I have a file named hostlist and another one called iplist. The hostlist
contains the hostnames of the hosts (one by one using a line break) and the
iplist contains the corresponding IP nos. Both files are having the correct
sequence of the name to ip. e.g.; the line one of the hostlist file's ip no.
is on the line one of the iplist file; the line 25 of the hostlist file's ip
no. is on the 25th line of the iplist file and so on. There are more than
hundred lines on both the files. Both files are having the same line numbers
also.

My question is how I can insert the hostname to the corresponding iplist by
using any unix utility like awk, sed or anything. So that I can avoid typing
it manually to create a /etc/hosts file (I need a tab separator in between
the ip and the host also).

iplist file hostlist file
------------- -----------
1xx.22.xx.xxx daq-13
1xx.20.xx.xxx sads-1
1xx.30.xx.xx bdat-1

Thanks in advance,
Rasheed.

--
             ---> 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:16 EDT