0
ループで各期待値条件をチェックし、if文を持つ方法はありますか?スクリプトが条件を確認する方法
#!/usr/bin/expect
spawn telnet 10.10.10.10
set timeout 200000000
expect "login"
send "user\r"
expect "Password:"
send "password\r"
send "./run/this.sh\r"
/*
Here is where I'm confused
*/
if[ "expect" = "close" ]
then
send "exit\r"
elif[ "expect" = "end" ]
send "exit\r"
fi
以下のロジックを使用できましたか? – Inian
私の解決策が問題の解決に役立った場合は、回答をupvoteで受け付けておいてください!ありがとう! – Inian
タイムアウトを無効にするには、 'set timeout -1'を使用してください。あなたが答えを2314.8日まで待つことを特に必要としない限り。 –