user974887 user974887 - 1 year ago 70
Linux Question

How do I script a "yes" response for installing programs?

I work with Amazon Linux instances and I have a couple scripts to populate data and install all the programs I work with, but a couple of the programs ask:

Do you want to continue [Y/n]?

and pause the install. I want to auto answer "Y" in all cases, I'm just now sure how to do it.

Answer Source

The 'yes' command will echo 'y' (or whatever you ask it to) indefinitely. Use it as:

yes | command-that-asks-for-input

or, if a capital 'Y' is required:

yes Y | command-that-asks-for-input
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download