title: how do i reduce timeout on unix telnet on connection
body: <p>I have a unix shell script which test ftp ports of multiple hosts listed in a file.</p>
  
  <pre><code>for i in `cat ftp-hosts.txt`
          do
          echo "QUIT" | telnet $i 21
  done
  </code></pre>
  
  <p>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 ?</p>