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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

size of expect buffer

Status
Not open for further replies.

tomdagliusa

Programmer
May 31, 2000
34
US
I have a test which is failing, and I think it is due to the match not occuring within the size of the expect buffer. I tried changing the size using the match_max command, but it doesn't seem to be working. Is this the right command, or is another available?

Thanks,
Tom
 
The match_max command is the one you want. To test out whether expect is really discarding buffer contents because it filled up, you can also try adding a [tt]full_buffer[/tt] pattern to your expect command, at least for testing purposes. See page 151 in the "Exploring Expect" book for more information, but basically if the [tt]full_buffer[/tt] pattern matches, Expect dumps all of the unmatched input into expect_out(buffer):

Code:
expect {
    $mypattern  {
        myaction
    }

    full_buffer {
        # The buffer filled up without matching a pattern.
        # The buffer was dumped into expect_out(buffer).

        puts "Unmatched input: $expect_out(buffer)"
    }
}

You might also want to turn on Expect's diagnostics to see what it really is and isn't matching. To do so, execute exp_internal 1. ("Exploring Expect" page 166 and beyond.) Just be aware that exp_internal generates a lot of output!

- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top