telnet bash code example Example: telnet in shell script { echo "remotecommand 1"; echo "remotecommand 2"; sleep 1; } | telnet 10.1.1.1