如何编写“是"脚本?安装程序的响应? [英] How do I script a "yes" response for installing programs?
本文介绍了如何编写“是"脚本?安装程序的响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Amazon Linux实例,并且有几个脚本来填充数据并安装与我一起使用的所有程序,但是有几个程序会问:
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]?
并暂停安装.我想在所有情况下都自动回答"Y",我现在确定该怎么做.
and pause the install. I want to auto answer "Y" in all cases, I'm just now sure how to do it.
推荐答案
是"命令将无限期地回显"y"(或您要求的任何结果).用作:
The 'yes' command will echo 'y' (or whatever you ask it to) indefinitely. Use it as:
yes | command-that-asks-for-input
或者,如果需要大写字母"Y":
or, if a capital 'Y' is required:
yes Y | command-that-asks-for-input
这篇关于如何编写“是"脚本?安装程序的响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文