expect script doesnt pass graphics chars correctly



Hi folks,

My expect script needs to automate login to a terminal server which is running a text based interface. The text based program assumes "scoansi" terminal type and "ibm850" character encoding.

When I carry out the login steps by hand everything works beautifully and the ansi graphics look good (well as good as it gets...). However when I try to automate this with expect, something is going wrong with the terminal emulation/setup/whatever and the graphics characters do not show properly. I feel it must be some sort of tty mode issue, but have not been able to find a solution. Any and all comments are welcome.

A transcript of my script:

#!/usr/bin/expect -f
spawn -nottyinit ssh -t someone@xxxxxxxxxxxx
set ssh $spawn_id
expect "*?assword: "
send -- "yadayada\r"
expect "\u0005"
stty -echo
send -- "okydoky\r"
stty raw -echo
interact -reset -output $ssh

Now I can interact, but all of the graphics chars are garbled.

eg ?Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"Ã"
instead of -----------------

Any ideas? Or can I jump out of expect somehow at the end (I dont need it anymore once the last send has been done).

Jeremy
.



Relevant Pages

  • Re: Redirecting stdout and stdin
    ... > I am working on a script that calls a program ssh in this case. ... > script needs to be non-interactive so I need python to comunicate with ... It also needs a distinct source for the password input, ...
    (comp.lang.python)
  • Redirecting stdout and stdin
    ... I am working on a script that calls a program ssh in this case. ... script needs to be non-interactive so I need python to comunicate with ...
    (comp.lang.python)