Change size of the expect_out buffer in Expect

While reading output, more than 2000 (think of a 25 x 80 terminal) bytes can force earlier bytes to be “forgotten”. This may be changed with the function match_max. (Note that excessively large values can slow down the pattern matcher.) If patlist is full_buffer, the corre- sponding body is executed if match_max bytes have been received and no other patterns have matched. Whether or not the full_buffer keyword is used, the forgotten characters are written to expect_out(buffer).

             taken from 'man expect'

I’ve found that match_max can cause expect_out(buffer) to become undefined. Redefine it after calling match_max to get round this.

   match_max 5000
   set expect_out(buffer) {}

As noted by Cameron Laird here: http://phaseit.net/claird/comp.lang.tcl/expect.html

Advertisements
Change size of the expect_out buffer in Expect

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s