[expect] how to match multiple times in one expect

From: Sektor van Skijlen (sektor_at_hasiok.org)
Date: 07/29/04


Date: 29 Jul 2004 14:59:03 GMT

Hello,

Let's say, I have the following output in response to sent command:

=============================
DEVICE | STATE
=============================
LKS1 | ON
LKS2 | ON
LKS5 | ON
LKS6 | ON
-----------------------------

I'd like just to collect info about these "LKS".

There is a good recognizable "device entries" and "end of output",
definable by regular expressions.

How could the expect repeat "expecting" (and "stop expecting", when "end of
output" has been reached)? I used exp_continue, when recognizing the device
entry, but expect ate up one entry and gave up, though.

Of course, an alternative way is to look over the expect_out(buffer), but
I hope there is an easier way to do it.

-- 
 1 6   1     7   4      4 2       548 g4bc7a4 66z  3xt7w v1y z9p1 120  32
((        Michal "Sektor" Malecki  w4  66  64  73  7564   24  5 v  34  4
 )) ektor van Skijlen               1  5    5  1   844    a   v r  z   4
Software engineer, Motorola GSG Poland 1       2    2a        1        4
WARNING: Opinions presented by me on usenet groups are my personal opinions
         ONLY and are not connected to the employer.