expect script doesnt pass graphics chars correctly
- From: Jeremy Cook <jeremy.cook@xxxxxxxxxxx>
- Date: Mon, 19 May 2008 16:07:58 +0200
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
.
- Follow-Ups:
- Prev by Date: Re: How to escape this?
- Next by Date: Re: tcllib encyption aes compatibility
- Previous by thread: Problem with list objects in the tcl C library.
- Next by thread: Re: expect script doesnt pass graphics chars correctly
- Index(es):
Relevant Pages
|