Training, Open Source computer languages

This is page http://www.wellho.net/forum/The-Tcl- ... guage/Expect-telnet-skips-characters.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Expect / telnet skips characters

Posted by kajkaj (kajkaj), 11 September 2007
Hello,

I have an Expect script containing:

Code:
send -- "i 1 liabETH0=$liabETH0\r"
sleep 1
expect -re ".*\r
Param>"
sleep 1
send -- "i 2 liabETH1=$liabETH1\r"
sleep 1
expect -re ".*\r
Param>"
sleep 1
send -- "i 3 liabIP0=$liabIP0\r"
sleep 1
expect -re ".*\r
Param>"
sleep 1
send -- "i 4 liabIP1=$liabIP1\r"
sleep 1
expect -re ".*\r
Param>"
sleep 1
send -- "i 5 liabHOST=$liabHOST\r"
sleep 1
expect -re ".*\r
Param>"
sleep 1
send -- "i 6 liabJFFS2=$liabJFFS2\r"
sleep 1
expect -re ".*\r
Param>"
sleep 1
send -- "i 7 liabRUN=$liabRUN\r"
sleep 1
expect -re ".*\r
Param>"

...but I get some strange hickups. Every now and then a letter disappears in the output I see in my terminal. If for instance $liabHOST is "name.domain.dk" i see this in the terminal:
Code:
Param>i 5 liabHOST=nme.domain.dk

but the program in question (a bootloader) did get the full string when I check afterwards. liabHOST is "name.domain.dk".

These random hickups are really bugging me, as I need to present the output from the expect script in a Gtk UI, and sometimes this fails with a "Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed" error, whenever the expect scripts do something strange.,

Can anyone point me in the direction of a solution?

Posted by admin (Graham Ellis), 11 September 2007
Are you echoing to the screen by leaving log_user set to 1?  Does it make any difference if you change it to zero and the use the response string in expect_out?  In fact have you checked whether or not expect_out is correct (and is it?) - that extra evidence would help define the problem

Posted by kajkaj (kajkaj), 13 September 2007
Thanks for the reply. It seems that the program I used to do the communication was the one dropping characters.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho