Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
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.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2022: 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