This is how i execute my tasks in terminal without using &&
for i in google.com yahoo.com;do ping -c1 $i;echo $i;done
Similar to you have to put this command in a script
for i in google.com yahoo.com
do echo $i;ping -c1 $i;
done
Both giving same output to me
google.com PING google.com (172.217.26.174) 56(84) bytes of data. 64
bytes from google.com (172.217.26.174): icmp_seq=1 ttl=56 time=259 ms
--- google.com ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev =
259.794/259.794/259.794/0.000 ms yahoo.com PING yahoo.com (98.138.253.109) 56(84) bytes of data. 64 bytes from yahoo.com
(98.138.253.109): icmp_seq=1 ttl=51 time=398 ms
--- yahoo.com ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev =
398.974/398.974/398.974/0.000 ms