I am trying to run an expect script, that everytime the prompt says user@blah's password, it enters the password I have the following expect script but it seem to be acting up.
Can anyone tell me what i am doing wrong? This prompt comes up multiple times over the command i run so i need it to enter the password every time, it sees user@blah's password.
#!/usr/bin/expect
global env
set timeout 10
spawn command that requires password
expect "^user"
send "password\r"
Please and thank you.