Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expect Package breaking good ole 'puts'???

Status
Not open for further replies.

tktuffkid

Programmer
Dec 12, 2006
11
US
I have spent the last couple of hours what appeared to be the most trivial of problems. Although I am able to workaround the problem, I am curious as to what is causing the problem...

In a nutshell, I had a standalone TCL script that essentially sat in a loop for 512 iterations...printing out information to stdout for each of the iterations.

When I ran the script from my Linux bash shell, only 280 or lines would get printed out...not 512. However, if I redirected to a file using Linux I/O, the file would appropriately contain 512 lines of my data.

With this knowledge I started toying around with every 'fconfigure' command available....but to no avail. I then started to inspect my script line by line and it wasn't until that I commented out 'package require Expect' did the problem go away. You can test it out with this very simple script below and notice the results by commenting in/out the 'package require Expect' line.

#!/bin/env tclsh
package require Expect
for {set i 0} {$i < 512} {incr i} {
puts "$i: 123456789012345678901234567890"
}

So my question is...what on earth is Expect doing to cause me to break good ole puts???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top