Reputation: 7107
The problem with this script is that if there are any yum
updates, then it still exits.
#!/usr/bin/expect
spawn su -c "yum update"
expect "Password: "
send "secret\n"
expect eof
exit
I would like to be able to answer yes or no in that situation.
Question
Is it possible to just have except
to answer the password question, and then let the rest be interactive?
Upvotes: 2
Views: 98
Reputation: 20798
For example:
#!/usr/bin/expect
spawn su -c "yum update"
expect "Password: "
send "secret\n"
interact
exit
Upvotes: 1