Reputation: 1837
I have an executable binary which when runs asks for a share password that's common to that service. I want to automate the password filling by using the shell script 'expect' and 'send' feature. I want to know what exactly to fill in the expect. The prompt spans across the multiple lines. Should I fill in the last line or entire message.
Shareserver or network failure -1: please enter keys locally.
Recovering key, 1 share required.
Please enter a share password:
Currnetly i'm doing
./My_binary_to_execute.tst
expect "Please enter a share password:"
send "share_pwd"
I'm not getting the password filled and i'm prompted again. What's the exact usuage? Please don't worry about security. The password is shared and known to the organisation and the binary too is not a critical one.
Upvotes: 0
Views: 362
Reputation: 353
You should expect the last line. There is different reasons why your script is not working. Maybe it is because you do not send carriage return after your password:
send "share_pwd\r"
Or maybe your binary opens another shell, which expect does not see.
Upvotes: 0