#!/bin/bash ( exec 3</dev/tcp/$1/$2 ) >/dev/null 2>&1 if (( $?==0 )) ; then echo "yes"; else echo "no"; fi; exec 3<&-