Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expect -transfer open connections?

Status
Not open for further replies.

dav1981

ISP
Nov 21, 2010
1
0
0
GB
Is it possible to transfer an open spawn session to putty.

Some devices are not route-able and I need to telnet to border device then telnet from there to the device I want to connect too.

I would like the user to see only the final connection and interact with it.

I'm currently receiving the following error from putty

Unable to open connection to exp7
Name or service not known


example code

#!/bin/sh
package require Expect

spawn telnet 192.168.1.12
set id $spawn_id
expect "Username:"
exp_send "cisco\r"
expect "Password:"
exp_send "cisco\r"
expect "%"

spawn putty -telnet $id
expect "%"
interact

thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top