How do I script a “yes” response for installing programs?

后端 未结 6 1679
面向向阳花
面向向阳花 2020-12-02 06:15

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:

D         


        
6条回答
  •  失恋的感觉
    2020-12-02 06:42

    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
    

提交回复
热议问题