Re: expect: how to clear expect_out(1,string)
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: expect: how to clear expect_out(1,string)

From: Uwe Klein <uwe_klein_habertwedt@t-online.de>
Date: Tue Mar 07 2006 - 12:01:21 CET

andyhaupt@netscape.net wrote:
> Hello Uwe,
>
> if in your first post you would have reversed the order of the first
> two inputs
> ie. first input is 'pat1pat2' and second input is just 'pat2'
> you would have seen what I mean:
been a bit trigger happy with the send button ;-/
> after the second input you still see expect_out(1,string) filled with a
> value
> (if you adapt your code and also loop through 0,1,2,3)
> in fact it is the previous one and it is not cleared.
> my question was: is there a way to clear it.
[unset] works.
>
> I'm ok with the alternative solution of having a sequence of patterns
> (which is also probably easier to understand) but I wanted to know if
> the '(pat1)?(pat2)' method and thus having to clear
> expect_out(1,string) can be achieved.

I found long regexp's prone to breaking.
A really long and convoluted one may show your brilliance
but not the objective you aim for.
using more matches and some flags may show the workings in
a more obvious way.

>
> rgds
> andy
G!
uwe
Received on Sun Apr 30 02:25:35 2006