Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要什么:
telnet 1.1.1.1 (no password or login required) #connected telnet localhost 1234 command_1 command_2 command_3 exit exit
有什么办法可以在 bash 或 python 上编写它?
You can pass input to telnet using a pipe. At your shell:
$ echo "echo -e 'command_1\ncommand_2\ncommand_3' | telnet localhost 1234" | telnet 1.1.1.1