Hi,
I having this problem:
I issue command1 and use a timeout to terminate the expect() call since
I don't know what I'm going to get back from command1. This sets
before() to command1's output as expected.
I issue command2 with both a pattern match and a timeout. I find that
when the output from command1 contains the pattern match, the expect()
call for command2 terminates before it's looked at the output from
command2, and I essentially get out of sync with commands and command
output.
I tried clear_accum() between command1 and command2, but before() was
not altered, and the problem persists.
I would have thought Expect would have sucked up command1's output into
before() and made it unavailable for matching on future expect() calls.
Guess not, but I can't seem to get rid of it with clear_accum(). It
seems that an actual pattern match acts differently from a timeout in
terms of what is available to match on the next expect() call. For a
timeout, the contents of before() appears available for matching on the
next expect() call while on an actual pattern match, before() is not
available.
Ideas on how to fix this? I thought of making a call to expect()
between command1 and command2 feeding the end of the before() result
which should cause an actual pattern match. Is there a simpler/more
elegant way?
-Eric
|