title: This is nc from the netcat-openbsd package. An alternative nc is available
body: <p>I am using following piece of code on Ubuntu 14.4 to check whether ssh port in my remote machine is open or not</p>
  
  <pre><code>$PROXY_SERVER_IP=192.168.1.40
  
  $LOGGER "Waiting for Proxy-VM ssh port to become active.."
  while ! nc -z $PROXY_SERVER_IP 22; do
    sleep 10s
  done
  </code></pre>
  
  <p>Above code works some time but other time it result in infinite loop with following message</p>
  
  <pre><code>This is nc from the netcat-openbsd package. An alternative nc is available
  in the netcat-traditional package.
  usage: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port]
        [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]
        [-x proxy_address[:port]] [hostname] [port[s]]
  </code></pre>
  
  <p>Is there any other way to to know whether port is open or not ?</p>