linux - 即使 "expect"不匹配任何东西,是否可以继续执行

标签 linux shell interpreter expect

有没有办法让 expect interpreter 说出类似的话

expect {
  "keyword1" {send "action1"}
  "keyword2" {send "action2"}
  unpredicted stuff {send "action3"}
}

最佳答案

您可以在模式主体中使用 exp_continue 以在匹配后进行 expect 循环。您可以使用通用 .* 非上述类型的正则表达式来表示“意外的东西”,但您应该将其限制为行或词而不是 .*其他关键字适用的粒度。

关于linux - 即使 "expect"不匹配任何东西,是否可以继续执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7737533/

相关文章:

linux - 我可以运行使用 2 个不同命令行的脚本吗?

python - while True 还是 while 1?

javascript - C 中的 ECMAScript-262 实现?

linux - Linux下/sys/devices下创建文件

linux - Linux 终端中运行的命令输出到文本文件

linux - 脚本 : Rename and remove duplicate directories

python - 注释会减慢解释语言的速度吗?

linux - 保存for循环的输出

javascript - Opera preventDefault() on keydown 事件

shell - 更改 Perl 6 的 $*OUT 是否会更改子进程的标准输出?