I would like to do following:
I have a bash script that calls an interactive command that asks the user for a passphrase. I want to specify the passphrase in the script as a variable, and pass that variable to the command non-interactively.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe you would like to look into expect. This utility is designed specifically for typing on behalf of the user.
Assuming your script has a prompt (or a line that dependably appears before user interaction is required), expect can parse the output, and when it sees the line, e.g., ‘passphrase:’, enter your passphrase and continue execution of the script.