I discovered that what runs manually does not work under
the Expect script. Any clues why?
The following output is displayed in overlayed lines. It
takes about 30 seconds to run. I had expected to see USR's
ati6 output. Here's what I got instead....
attach s6
ATX4V0E0Q0
ati6
empty
#Telnet to Portmaster, input DevName
proc TelnetToPM {DevName} {
global PMdevNames
global Passwords
set timeout 20
spawn telnet
expect "telnet> "
send "open $DevName\r"
expect "login: "
send "!root\r"
expect "Password: "
puts stdout "[lindex $Passwords [lsearch $PMdevNames $DevName]]\r"
}
TelnetToPM fern-pt.olympus.net
set expect_out(buffer) "empty"
send "attach s6\r"
expect "'^]'.\r"
send "ATX4V0E0Q0\r" X4: display all result codes
expect 0
send ati6
expect USRobotics
puts $expect_out(buffer)
exit
The init string ATX4V0E0Q0 consists of...
X4 result codes
V0 display result codes numericaly
E0 command mode echo enabled
Q0 result codes displayed