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?
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?
Thanks. The output is in the form of xxxx | x.x.x.x | something else here. i was able to form a regular expression in php but I wanted to know where I can place such a thing here in unix.
Oh... Sorry. I should've mentioned that. nc is netcat. And AS is just a number associated with an IP address. It tells if the IP address belongs to a particular ISP or not...
Oh.. Ok..Thank you... Then I'll start reading Perl.. But will I be able to do all these with that?
Execute shell commands
Grab the output like the popen command you showed me yesterday
Work with regular expressions
Read and write into files
I was wondering if SQL commands can be executed