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: Mon Mar 06 2006 - 19:35:46 CET

Uwe Klein wrote:
ups a bit too fast:
unset the matches:

> expect_user {
> -re "(pat1)*?(pat2)" { # pat1 and pat2 have been seen
> puts HIT:pat12
> foreach idx {0 1 2 3} {
> catch {set expect_out($idx,string)} cerr
> puts $idx:$cerr
!! catch {unset expect_out($idx,string)}
> }
> }
> -re "(pat2)" { # only pat2 has been seen
> puts HIT:pat1 }
> }

uwe
Received on Sun Apr 30 02:25:04 2006