我需要一些幫助來指揮他。我正在嘗試自動解壓縮 teampeak 3 Linux 用戶端。
這是我抓取文件的腳本
#!/bin/sh
mkdir /home/test && cd /home/test
wget http://dl.4players.de/ts/releases/3.0.19.4/TeamSpeak3-Client-linux_amd64-3.0.19.4.run
chmod 0777 TeamSpeak3-Client-linux_amd64-3.0.19.4.run
這是我的期望腳本,在上面的腳本之後執行...
#!/usr/bin/expect -f
spawn sh TeamSpeak3-Client-linux_amd64-3.0.19.4.run
expect "\[RETURN\]"
send "\r"
expect ":"
send "q"
expect "Please type y to accept, n otherwise:"
send "y\n"
它不會解壓縮,但它應該解壓縮。
太感謝了!
答案1
這似乎對我來說工作(我還沒有測試最終安裝)
#!/usr/bin/expect -f
spawn ./TeamSpeak3-Client-linux_amd64-3.0.19.4.run
expect "\[RETURN\]" {send "\r"}
expect ":" {send "q"}
expect "otherwise:" {send "y\r"}
expect eof {exit}