Re: How to control the loop within expect.
- From: Uwe Klein <uwe_klein_habertwedt@xxxxxxxxxxx>
- Date: Fri, 28 Apr 2006 11:02:51 +0200
Hu Junfeng wrote:
Thanks.He has already done this. expect has a complete programming language
I just use this way to solve the problem
I still want to know is any better choice for this.
Maybe Don libes should consider this function in the next version of
expect:)
for this at its beck and call (tcl ;-)
You can loop inside a call to [expect] with exp_continue like
set timeout 100
set ::customers 0
spawn ~/myshow --product books
expect \
customer {
incr ::customers
exp_continue
} thief {
puts stderr "GOTCHA"
do_call_911
} timeout {
puts "slow day"
exp_continue
} eof {
puts "shop closed"
puts "had $::customers customers today"
do_go_home
}
this will stay inside [expect] till close or a thief comes along
uwe
.
- References:
- How to control the loop within expect.
- From: hujunfeng
- Re: How to control the loop within expect.
- From: Aric Bills
- Re: How to control the loop within expect.
- From: Hu Junfeng
- How to control the loop within expect.
- Prev by Date: Re: How to control the loop within expect.
- Next by Date: Re: diff type operations in TCL
- Previous by thread: Re: How to control the loop within expect.
- Next by thread: Re: How to control the loop within expect.
- Index(es):
Relevant Pages
|