How to Telnet via BASH Script

This article will show you how to Telnet via BASH script and return the status as open or close. This has been tested on CentOS/RedHat and hopefully should work on all other Linux distributions as well.

Create a file telnet_script.sh. This script is to Telnet SSH port i.e. 22