I have a file that looks like this:
Code:
1: 192.168.1.1 (192.168.1.1) 0.691ms
1: 192.168.1.2 (192.168.1.2) 0.279ms
2: 12.213.12.123 (12.213.12.123) 1.385ms
3: 45.213.12.221 (45.213.12.221) 11.334ms
I want to run a script which will ping all the ip addresses in the brackets, one at a time and save to a file.
I know how to ping and save to a file, but I dont know how I can get the IP addresses from this file into an array or do some kind of regex loop?
Thanks for your help