I am writing a tcl/expect script to check for the a string output of an event and if found then do something. Below is the code i have,
proc cli_detect_event {cmd value} {
cli_send "$cmd"
expect -timeout 3 $value {
} timeout fail
}
So when i send $cmd i get and event which should match $value hopefully. I was wanting to know is there a way to prevent what's in the expect_out(buffer) from being thrown away when expect is used again after this proc, so that I could expect match on the same outputs from the command I sent?