I have a program that runs and asks users certain questions. I want to automate it so that every question is responded to with No.
Share
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.
Where
<command>is the command you want to answernoto.(or
yes nif you actually need to just output ann)The
yescommand, by default, outputs a continuous stream ofy, in order to answer yes to every prompt. But you can pass in any other string as the argument, in order for it to repeat that to every prompt.As pointed out by “just somebody”,
yesisn’t actually standardized. While it’s available on every system I’ve ever used (various BSDs, Mac OS X, Linux, Solaris, Cygwin), if you somehow manage to find one in which it doesn’t, the following should work:Or as a full-fledged shell script implementation of
yes, you can use the following: