expect + telnet hangs on AIX



Hello does anybody use expect + telnet on AIX
A cannot make it to work as it hangs soone or later.
I even tried to spawn sh instead of telnet and then
'send' telnet commans but has no luck.

[grs1]/grs1/home/tst > cat tt
spawn telnet localhost
expect -timeout 10 "assword: " { exit }

[grs1]/grs1/home/tst > expect -d tt
expect version 5.43.0
argv[0] = expect argv[1] = -d argv[2] = tt
set argc 0
set argv0 "tt"
et argv ""
executing commands from command file tt
spawn telnet localhost
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {409760}

expect: does "" (spawn_id exp4) match glob pattern "assword: "? no
Trying...

expect: does "Trying...\r\n" (spawn_id exp4) match glob pattern
"assword: "? no
telnet: connect:expect: does "Trying...\r\ntelnet: connect: "
(spawn_id exp4) match glob pattern "assword: "? no
Connection refused

expect: does "Trying...\r\ntelnet: connect: Connection refused\r\n"
(spawn_id exp4) match glob pattern "assword: "? no
expect: read eof
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "Trying...\r\ntelnet: connect:
Connection refused\r\n"



if I modify the script to connect to other system and then call
intertact
than after I type exit expect hangs too



Regards, Konstantin
.



Relevant Pages

  • expect: spawn id exp7 not open error.
    ... I am trying to launch another program using telnet in the following ... Error: expect: spawn id exp7 not open ... displayf "You may try the operation again.\n" ...
    (comp.lang.tcl)
  • how to automate telnet thro expect cmd
    ... I want to automate my telnet connection(instead of typing ... repeated username & password) ... I suppose i can write expect script ... eval spawn telnet ip ...
    (comp.os.linux.misc)
  • how to automate telnet thro expect cmd
    ... I want to automate my telnet connection(instead of typing ... repeated username & password) ... I suppose i can write expect script ... eval spawn telnet ip ...
    (comp.os.linux)
  • how to kill running proc in TCL/tk
    ... round check for my network devices, in each check I spawn a telnet to ... exit from telnet and sleep for a while, ... I can add a buttonin my panel, if click the button, then ... system will kill all running proc, ...
    (comp.lang.tcl)
  • Re: expect matches on "?" when it is not there
    ... eval spawn telnet $ ... puts $LOGIN_ERROR "$Unable to connect to switch, Connection ... "Escape character is '^]'." ... parent: ...
    (comp.lang.tcl)