我有一个expect
脚本作为bash函数的一部分。该脚本必须处理以下内容:
我如何做以下事情:
if [expect "continue?" then { send "y\r"; exp_continue }]
else exp_continue
感谢。
答案 0 :(得分:1)
set timeout 3 # wait 3 seconds for "continue?"
expect {
"continue?" { send "y\r"; }
timeout { }
}
set timeout 10 # return to 10-second default