I have a small .sh script, as below (ignore /dev/null , that\'s a hack I am using;
#!/bin/bash while read host port; do echo `timeout 5 telnet $host $port