Host: 188.8.131.52 () Ports: 8080/open/tcp//http-proxy/// Ignored State: filtered (28) Host: 184.108.40.206 () Ports: 8888/open/tcp//sun-answerbook/// Ignored State: closed (28) Host: 220.127.116.11 () Ports: 1263/open/tcp/////, 1499/open/tcp//fhc///, 2301/open/tcp//compaqdiag///, 3124/open/tcp/////, 3127/open/tcp/////, 3128/open/tcp//squid-http///, 3382/open/tcp/////, 4480/open/tcp//proxy-plus///, 4816/open/tcp/////, 6588/open/tcp//analogx///, 7212/open/tcp/////, 8000/open/tcp//http-alt///, 8080/open/tcp//http-proxy/// Ignored State: closed (4)
Desired output would be
18.104.22.168:8080 22.214.171.124:8888 126.96.36.199:1263 188.8.131.52:1499
I know how to handle it if there was 1:1 ratio of IP to ports, but there can be multiple ports open for a single IP. I've just been grepping the output from the file with an appropriate regex for each part and putting it in an array, is there an easier way of doing things? My text manipulation skills in nix are very rudimentary.