您已经
eof在循环结束时等待了,您只需要使用
wait和
catch结果即可:
spawn trueexpect eofcatch wait resultexit [lindex $result 3]
以0退出。
spawn falseexpect eofcatch wait resultexit [lindex $result 3]
以1.退出。

您已经
eof在循环结束时等待了,您只需要使用
wait和
catch结果即可:
spawn trueexpect eofcatch wait resultexit [lindex $result 3]
以0退出。
spawn falseexpect eofcatch wait resultexit [lindex $result 3]
以1.退出。