não funcionou.
Para testar o conceito fiz um script que lê um arquivo com algumas URL's e faz um ping em cada endereço, depois imprime o parâmetro 2:
[sagetr1@servsage1 simul]$ ./programa.sh ips teste
192.168.88.1
google.com.bruol.com.brubuntu.comPING 192.168.88.1 (192.168.88.1) 56(84) bytes of data.
64 bytes from
192.168.88.1: icmp_seq=1 ttl=64 time=11.0 ms
--- 192.168.88.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 11.078/11.078/11.078/0.000 ms
PING
google.com.br (172.217.29.163) 56(84) bytes of data.
64 bytes from
gru10s02-in-f163.1e100.net (172.217.29.163): icmp_seq=1 ttl=50 time=15.0 ms
---
google.com.br ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 15.089/15.089/15.089/0.000 ms
PING
uol.com.br (200.221.2.45) 56(84) bytes of data.
64 bytes from
home.uol.com.br (200.221.2.45): icmp_seq=1 ttl=244 time=22.0 ms
---
uol.com.br ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.068/22.068/22.068/0.000 ms
PING
ubuntu.com (91.189.94.40) 56(84) bytes of data.
64 bytes from
ovinnik.canonical.com (91.189.94.40): icmp_seq=1 ttl=52 time=198 ms
---
ubuntu.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 198.223/198.223/198.223/0.000 ms
teste
Obrigado.