Automating telnet session using Bash scripts
While I’d suggest using expect, too, for non-interactive use the normal shell commands might suffice. telnet accepts its command on stdin, so you just need to pipe or write the commands into it through heredoc: telnet 10.1.1.1 <<EOF remotecommand 1 remotecommand 2 EOF (Edit: Judging from the comments, the remote command needs some time to … Read more