1
我正在創建一個簡單的自動腳本。這裏是代碼我在使用expect時需要使用spawn嗎?
#!/bin/sh
echo "testing expect"
/usr/bin/expect <<delim
expect "password for teamer:"
send "itsme\r"
expect eof
delim
sudo apt-get update
我指的是各種文件和博客,他們正在使用產卵。所以我有問題:是否有必要每次都使用spawn
?我在本地機器上執行更新。
不使用產卵我得到這個錯誤:
send: spawn id exp0 not open while executing
還是我失去了一些東西?