I need to automate telnet to a Cisco router and get a "show version" result. The problem is, I need to first to telnet to A, from there telnet to B and then only be able to telnet to the Cisco router.
I've tried below, but didn't work.
root@linux:~#cat command
myName
myPassword
telnet 2.2.2.2
myName2
myPassword2
telnet 3.3.3.3
cisco
ciscoPass
show version
root@linux:~#nc 1.1.1.1 23 -i 1 < command