Training, Open Source computer languages

This is page http://www.wellho.net/forum/The-Tcl- ... guage/can-t-read-quot-expect-out-buffer-quot-no-such-variable.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))
can't read "expect_out(buffer)": no such variable

Posted by AndyS (AndyS), 6 December 2004
I encountered this error when running a script that had been running, but that I heavily modified.

I got is down to the following 4 lines:

#!/usr/local/bin/expect
puts "Enter 'hi', then ENTER"
expect "hi\n"
puts "buf: $expect_out(buffer)"

When I type in "hi\n", the 'puts' works OK
When I let it time out, I get this error:

can't read "expect_out(buffer)": no such variable
   while executing
"puts "buf: $expect_out(buffer)..."
   (file "trm22" line 4)

I can't see what's going on.
I'm running expect version  5.7.0 on a UNIX system.

Any help would be appreciated.

Thanks,
            Andy


Posted by admin (Graham Ellis), 6 December 2004
Hi, Andy .. I've NOT got my expect stuff with me but I'm wondering if you try typing in something before "hi" do you get that reported back?    What if you do an
   array names expect_out
... what do you see?

Posted by AndyS (AndyS), 6 December 2004
I added that line to make it look like this

#!/usr/local/bin/expect
puts "Enter 'hi', then ENTER"
expect "hi\n"
array names expect_out;
puts "buf: $expect_out(buffer)"


That gave me the following error:

Enter 'hi', then ENTER
anb hi def
"expect_out" isn't an array
   while executing
"array names expect_out"
   (file "/home/scharmer/expect/trm22" line 4)

It looks like I can't look at expect_out(...) at all.



Posted by admin (Graham Ellis), 6 December 2004
Hmm ... think you have your threads mixed??   I've posted a quick thought on the other active thread ...



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