0
我正在嘗試在期望腳本(以下代碼)內運行期望腳本。但是,我收到以下錯誤:在期望腳本中啓動期望腳本
spawn ./script.exp
couldn't execute "./script.exp": no such file or directory
while executing
"spawn "./script.exp""
(file "./script.exp" line 7)
我有雙重檢查和script.exp存在並位於/ home/user/scripts目錄中。
#!/usr/bin/expect
spawn ssh [email protected]
expect "$"
send "cd /home/user/scripts\r"
expect "$"
spawn "./script.exp"
expect "$"
send "logout\r"
'spawn'在你的本地機器上啓動一個新的進程。要在遠程機器上啓動該腳本,請使用'send「./script.exp\r」' –
謝謝。有用。 – synthesis