linux - 如何为安装程序编写 "yes"响应脚本?

我使用 Amazon Linux 实例,我有几个脚本来填充数据并安装我使用的所有程序,但有几个程序会询问:

Do you want to continue [Y/n]?

并暂停安装。我想在所有情况下都自动回答“Y”,我现在才知道该怎么做。

最佳答案

'yes' command将无限期地回显“y”(或您要求的任何内容)。将其用作:

yes | command-that-asks-for-input

或者,如果需要大写“Y”:

yes Y | command-that-asks-for-input

如果你想传递 'N' 你仍然可以使用 yes:

yes N | command-that-asks-for-input

关于linux - 如何为安装程序编写 "yes"响应脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7642674/

相关文章:

linux - Bash 中的脚本参数

python - pip 安装 : Please check the permissions and

linux - 如何获取 Linux/UNIX 上当前的网络接口(interface)吞吐量统计信息

python - 如何从一列中对 Pandas 数据框进行排序

linux - Linux Bash 中的双与号 (&&) 和分号 (;) 有什么区别?

python - numpy 矩阵向量乘法

python - 如何将整数时间戳转换为日期时间

python - 如何在 Python 中将方法作为参数传递

asp.net - 在基于 Linux 的服务器上运行 ASP.Net

python - "hashable"在 Python 中是什么意思?