Re: How to control the loop within expect.
- From: "Gerald W. Lester" <Gerald.Lester@xxxxxxx>
- Date: Sat, 29 Apr 2006 00:13:13 -0500
Hu Junfeng wrote:
Bruce Hartweg 写道:
...
Thanks, it works:)
But I find another problem with it ,if I put the continue in a
procedure, it will not works again. for example:
Read the man/help page on the return command.
proc CMD {con} {
upvar CMDSUCC CMDSUCC
upvar CMDFAIL CMDFAIL
send -i $con "cd /nodes\r"
expect {
-i $con
$CMDSUCC {
puts "succe"
continue
}
$CMDFAIL {
puts "fail"
continue
}
}
puts "123"
}
set i 0
if {$i==0} {
foreach $i {1 2 3 4 5} {
CMD $CLICom
}
} else {
puts "hehe"
}
the result is invoked "continue" outside of a loop
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.
- Follow-Ups:
- Re: How to control the loop within expect.
- From: Hu Junfeng
- Re: How to control the loop within expect.
- References:
- How to control the loop within expect.
- From: hujunfeng
- Re: How to control the loop within expect.
- From: Bruce Hartweg
- 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: How to control the loop within expect.
- 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
|