Re: Expect timeout problem. I needs help.



Good Morning,

what OS and what type of machine is this.
How are you connected (console, xterm, serial line?)

where does it timeout? ( well with timeout -1
expect should sit there and melt into the ground )

could you bolster the expects up a bit:

from
	expect "<phrase>"
to
	expect "<phrase1>" {puts stderr HIT1} timeout {puts stderr TIMEOUT1}
and
	set timeout 5 ;# ie 5 sec.

zelzel.zsu@xxxxxxxxx wrote:

set timeout -1
spawn $env(SHELL)
match_max 100000
expect -exact "\]0;brian@localhost:~\[brian@brian brian\]\$"
send -- "su\r"
expect -exact "su\r
Password: "
send -- "sec1123\r"
expect -exact "\r
\]0;brian@localhost:/home/brian\[root@brian brian\]\$"
send -- "whoami\r"
expect -exact "whoami\r
root\r
\]0;brian@localhost:/home/brian\[root@brian brian\]\$"
send -- "exit\r"
expect -exact "exit\r
exit\r
\]0;brian@localhost:~\[brian@brian brian\]\$"
send -- "exit\r"
expect eof

.



Relevant Pages

  • Re: Strange graphical problem in xterm
    ... I'm trying to play nethack in a console window in KDE, ... You haven't set up xterm properly to emulate the ...
    (rec.games.roguelike.nethack)
  • Re: Strange graphical problem in xterm
    ... I'm trying to play nethack in a console window in KDE, ... You haven't set up xterm properly to emulate the ...
    (rec.games.roguelike.nethack)
  • Re: Strange graphical problem in xterm
    ... I'm trying to play nethack in a console window in KDE, ... You haven't set up xterm properly to emulate the pc ...
    (rec.games.roguelike.nethack)
  • Re: Strange graphical problem in xterm
    ... I'm trying to play nethack in a console window in KDE, ... You haven't set up xterm properly to emulate the ... normal install as far as it is concerned. ...
    (rec.games.roguelike.nethack)
  • Re: Using META and DEL keys in console
    ... > console mode. ... META works fine in an xterm. ... To get a key to send the familiar ^?, enter del in the keymap. ... a PC with a PC keyboard, and not trying to connect some ancient ...
    (freebsd-questions)