I run a linux command that sometimes asks for user input (press 1 or 2).
I always want to answer 1, how can I pass this value automatically ?
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.
Use the pipe
|operator to connect the output of one command to the input of another.If you want to repeat some input to a command, you can use
yes. By default it sends the string “y” repeatedly but it also repeat a different string of your choice.