![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reverse FTP | ganesh123 | Shell Programming and Scripting | 4 | 02-22-2007 02:20 PM |
| Reverse * | azmathshaikh | Shell Programming and Scripting | 2 | 04-26-2005 07:40 AM |
| Reverse lookup | jpalmer320 | IP Networking | 1 | 05-21-2004 09:36 AM |
| reverse lookup again | Westy564 | IP Networking | 1 | 01-12-2004 11:37 AM |
| reverse lookup file problem | Westy564 | IP Networking | 2 | 01-09-2004 02:55 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Reverse DNS problem
Hi everyone,
I am having a problem in the following area: I want to arrange list of Ip Addresses selected from a multiple files and make it look like this: "IP=192.168.0.1, hostname=snake.cooliris.com" Now i have already written the code to select the ip address from various files but want this part to be working. Thanks a lot. |
|
||||
|
Quote:
Whitout the code we can't tell you where the problem is! |
|
||||
|
Hey ,
my logic was to get as many file sin as possible so here is the half part of the code Please correct me if i am wrong. grep '^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$' followed by respective file names which lies under /var/lib/output/ for me atleast. Now i want to write the code for reverse dns here .....am i on the right path? I just wanted to add that i know the commands for reverse dns is Nslookup or dig -x followed by the ip address but the thing how do i make to take the ip address from various files and format it. Last edited by snake450; 08-26-2008 at 08:28 PM.. |
|
||||
|
Quote:
For IPv4 try this awk solution: Code:
awk -F'.' 'NF==4 && $1 > 0 && $1 && $2 && $3 && $4 <256' Regards, |
|
||||
|
Hey thanks for the reply but i am not aware how to use the system function to dig my ip from the previous result.....can you enlighten me on that part cause i am having a tough time figuring out how to make the function grab the ip from the grep expression and give it to the reverse dns process.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|