【发布时间】:2016-07-07 20:29:18
【问题描述】:
我有以下用于在串行端口上监听的代码:
set timeout -1
log_user 0
set port [lindex $argv 0]
spawn /usr/bin/cu -l $port
proc receive { str } {
set timeout 5
expect
{
timeout { send_user "\nDone\n"; }
}
set timeout -1
}
expect {
"XXXXXX\r" { receive $expect_out(0,string); exp_continue; }
}
为什么会给出一个
无效的命令名称“
在程序中超过 5 秒超时后出错?嵌套的期望可以吗?
【问题讨论】: