Telnet Alternative to Ping a TCP/UDP Port

Telnet Alternative to Ping a TCP/UDP Port

#!/bin/bash
# telnet alternative to ping a tcp port
# to ping udp port, use /dev/udp/$host/$port
## NOTE: this is a bash hack, not work in zsh.

host=$1
port=$2
echo >/dev/tcp/$host/$port
Tags:linux
Written on February 14, 2019