I\'m running telnet command on a host for a given port (which is open), it returns 0 (success).
telnet
For trying telnet manually, I type the following comman
Without using Expect, I guess using the HERE document (<
Expect
[vagrant@myvagrant /tmp] $ telnet_result=$(telnet `hostname` 2878 <
and for a bad/invalid/non-open port, the same gives 1 (as expected).
1
[vagrant@myvagrant /tmp] $ telnet_result=$(telnet `hostname` 287811111 <