的期望腳本返回無效的命令,而我試圖通過ssh無效的指令錯誤「的mkdir」,而excuting #expect腳本
這是下面的錯誤我
invalid command name "mkdir"
while executing
"mkdir new"
(file "./connecttotravalour.exp" line 8)
登錄到服務器後,創建一個文件夾
而且我期待的腳本代碼:
#!/bin/bash
#connect to travalour host
spawn ssh [email protected]
expect "password"
send "[email protected]\r"
interact
mkdir new
試試這個http://askubuntu.com/questions/703754/how-to-do-more-with-an-expect-script-than-just-a-log-in – jophab