I am running an application, which prompts for a password of the user about a dozen times :-( I tried using expect to circumvent this issue, and make it run in auto mode, but am unable to get over the issue of the multiple times password, which is not exactly static. Sometimes it asks 4-5 times and sometime around 9-10 times.
Is there a better solution to the problem than what I have given below:
spawn myApp [lindex $argv 0]
expect " password: $"
send "$password\r"
expect {
" password: $" send "$password\r"
"^Rollout Done "
"^Rollout Updated "
}
With the above solution, I have only been able to catch the password twice and then manually start entering for the rest of the time, is there a loop possible with the password?