Linux 预期工具和逻辑OR

Linux 预期工具和逻辑OR,linux,expect,Linux,Expect,我对脚本使用expect命令。我有几个不同的提示,我需要或的表达式 有可能这样做吗 expect { 'Hello. Press y for YES' *OR* 'Welcome again. Press y' {send -- "y\r" } } expect已具有或内置,例如: expect { "Hello. Press y for YES" {send -- "y\r"} "Welcome again. Press y" {send -- "y\r"} } 如果动作

我对脚本使用
expect
命令。我有几个不同的提示,我需要或的表达式

有可能这样做吗

expect {
   'Hello. Press y for YES' *OR* 'Welcome again. Press y' {send -- "y\r" }
}
expect已具有或内置,例如:

expect {
  "Hello. Press y for YES"  {send -- "y\r"}
  "Welcome again. Press y"  {send -- "y\r"}
}
如果动作太大,可以将其放入函数中。但如果您愿意,可以使用正则表达式a | b:

expect已具有或内置,例如:

expect {
  "Hello. Press y for YES"  {send -- "y\r"}
  "Welcome again. Press y"  {send -- "y\r"}
}
如果动作太大,可以将其放入函数中。但如果您愿意,可以使用正则表达式a | b: