期待するコードを作成しました:
#!/usr/bin/expect -f
spawn ls
expect "*]$*"
send "cd /to/some/path\n"
expect "*]$*"
send "sudo -u root ./program.sh"
「*:*」を期待し
て「i_am_password\n」を
送信
実行中に以下のエラーが発生します。
spawn ls
my_pgm.exp abc.sh axyz.zip all.zip test.exp
send: spawn id exp6 not open
while execution
"send "cd /to/some/path\n""
(file "./my_pgm.exp" 行5)
このコードをubuntuで実行しています。助けてください。