Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens when I pipe any command to a telnet session , why does the session closes

Tags:

bash

shell

telnet

What happens when I pipe any command to a telnet session , why does the session closes . How can I give a command which can be processes instead of closeing the connection .

I am trying

echo "xvz" | telnet 0 abc Trying 0.0.0.0... Connected to 0. Escape character is '^]'.

Which terminates the session instead of process xyz , what is other way i also tried

telnet 0 xyz < test
Trying 0.0.0.0... Connected to 0. Escape character is '^]'. Connection to 0 closed by foreign host.

like image 552
Gaurav Avatar asked Oct 19 '25 13:10

Gaurav


1 Answers

telnet does not process standard input and standard output.

You should check other programs like 'expect'.

like image 68
Chul-Woong Yang Avatar answered Oct 22 '25 02:10

Chul-Woong Yang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!