ActiveState Powered by ActiveState

ActiveState Community


Failing Expect command

Posted by dave_mairs on 2008-02-15 09:25

I have no trouble with the following command:

expect -i $id timeout {FAIL} anyway*
send "yes\r"
send_user "\n$expect_out(buffer),$expect_out(1,string)\n"

Why doesn't (what's wrong with the following:)

while 1 {
expect {
-re anyway? {send "yes\r"}
-re boot? {send "yes\r"}
-re $prompt {break}
}
}

shouldn't both examples achieve the same results?
In the While example,"anyway?" is never found!
Feel free to repair examples.

Thanks

DAve

-->