Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 expect_out 来获取以下代码段的最后一次发送的输出
while {[gets $cmds command]>=0} { send "$command\r" expect "*" set result $expect_out(buffer) puts $gout $result }
但 expect_out(buffer) 似乎保持所有以前的输出我怎样才能实现我的目标?谢谢
未经测试,但在发送命令expect * 之前尝试添加另一个。
expect *
如果在开发期望程序时有疑问,请添加exp_internal 1到脚本的顶部。
exp_internal 1