我試圖使用expect來自動接受在--more--中提示的EULA。期望和 - 更多 -
#!/usr/bin/expect
spawn "./greenplum-perfmon-web-4.1.2.0-build-2-RHEL5-x86_64.bin"
expect "--More--"
send "q"
expect "*****"
send "yes"
expect "*****"
send ""
expect "*****"
send "yes"
這是行不通的,我不知道爲什麼。該腳本始終在 - 更多 - 提示處停止,第二個腳本立即處理腳本的其餘部分。
我與
expect -exact "--More--"
和
expect "the Customer"
(what is written above the --More--)
設置'exp_internal 1'以獲得更好的調試輸出 – resmon6 2012-02-28 15:10:25
如果程序希望用戶點擊輸入,則將'send'改爲''發送到'發送'是\ r「'。 'expect「****」'可能會匹配任何內容,因爲默認匹配模式是'-glob','*'是glob特殊字符:使用'expect -exact ****' – 2012-02-28 20:06:33