The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-01-2007
Legend986 Legend986 is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 171
Need to execute the same statement

I have written a script for converting an IP address into its corresponding AS number in PHP. But based on the timing analysis, I've observed that it takes a long time to process large number of entries. So I need to do something directly in unix. What method would one suggest for this purpose?

Purpose:
There is a statement:
nc whois.sampleserver.com portnumber

After entering that, I need to enter the ip address and after entering it gives me the AS number in the forum of a line. I need to use regular expressions to capture the AS number and then store it in a file.

After this, I need to type that same command again and repeat the procedure.

Can someone please tell me what I have to do to achieve the above? Is it shell scripting or direct coding in languages like C?