#! /bin/sh sshLogin.csh max=255 i=1 outputfile=CSFastHosts`date '+%m%d%y_%H%M%S'` touch $outputfile while test $i -le $max do echo "128.82.4.$i : " host 128.82.4.$i | grep name > answer if test $? -eq 0 # is a valid host name then hostname=` cat answer | cut -d" " -f5 | cut -d"." -f1` timeoutcmd 1 TCPConnect $hostname 23 | grep Connected if test $? -eq 0 # is fast host then os=`ssh $hostname uname` echo "128.82.4.$i ($hostname): $os" >> $outputfile fi fi i=`expr $i + 1` done