[ubuntu-jp:1615] expect インストール実行エラー " spawn: not found"

yasuno fumikazu fumi.0000000 @ gmail.com
2009年 3月 6日 (金) 16:15:30 GMT


こんにちは。

Ubuntu8.10 を使っています。ご存知の方教えて下さい。

対話式ツール expectをインストールして以下のようなスクリプトを実行すると、
" spawn: not found" のエラーになってしまいます。

"whereis expect" を打つと、/usr/bin/expect にあります。
しかし、"rpm -q expect" を打つと、”パッケージ expect
はインストールされていません”が表示されます。パッケージが正常にインストールされなかったのでしょうか?
apt-get でインストールをしました。
原因がわかりません。 インストール方法、確認方法、スクリプトに誤りがありましたら教えて下さい。
また、初心者でもわかりやすく、expectの使い方が記載されているサイトご存知でしたら教えて下さい。お願いします

------------------------------------
#!/usr/bin/expect

set prompt "root @ ml115:/home/user1#"

set timeout 5

spawn sudo su

expect "[sudo] password for user1:"
send "user1pass\n"
expect "${prompt}"
send "mkdir /usr/local/test_dir\r"

interact

------------------------------------

【実行エラー詳細】
/home/user1/bin/ex_1.sh: 4: spawn: not found
couldn't read file "Password: ": no such file or directory
/home/user1/bin/ex_1.sh: 6: send: not found
couldn't read file "#": no such file or directory
/home/user1/bin/ex_1.sh: 8: send: not found
couldn't read file "eof": no such file or directory



ubuntu-jp メーリングリストの案内