OS=`uname -s` RSH="rsh -l user" RSH2="" PING="ping -c1 -w 3" PING2="" case $OS in HP-UX*) PING=ping PING2="-n 1" RSH="remsh" RSH2="-l user" ;; SunOS*) PING="ping" PING2="" ;; esac ... for i in server1 server2 server3 workstation1 workstation2 do $PING $i $PING2 > /dev/null if [ "$?" != "0" ]; then echo echo " Couldn't reach Host $i !" echo continue fi $RSH $i $RSH2 uptime done