#!/bin/ksh #Try to connect to the echo server of every host on the network. for host in `localhosts.pl 131.211.194.00 24 | awk '{print $2}'` do telnet $host 7 & sleep 1 if ps -p $! > /dev/null #if the telnet is still running then sleep 4 kill -9 $! #kill the telnet fi done