#!/bin/bash ips="www.google.com" for i in $ips do if ping -c 1 $i > /dev/null ; then echo "$i : Success" else echo "$i : Failed" fi done