interaction between expect and shell, expect return code and exit

view story

http://stackoverflow.com – I have a bash script, exec.sh like some command expect test.exp continue other command in the test.exp file, I have a snippet like: while {[gets $cmds command]>=0} { send "$command\r" expect { "*OK*" {puts $vout $command} "*fail*" {puts $iout $command} "*blocked*" { what should I put here????} } } so I want to put something in the curly bracket so that the execution exit the test.exp and signal the bash script exec.sh, so exec.sh also exit my idea is the set a outer variable and then in exec.sh use "if" judge statement are there any ideas? thanks! (HowTos)