|
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?
|