I have a unix shell script which test ftp ports of multiple hosts listed in a file.
for i in `cat ftp-hosts.txt`
do
echo "QUIT" | telnet $i 21
done
In general this scripts works, however if i encounter a host which does not connect, i.e telnet is "Trying...", how can I reduce this wait time so it can test the next host ?