我有一个简单的bash脚本连接到一系列服务器并更新特定的包,使用here-string来回答提示:
sudo /usr/bin/apt-get install package-name <<< Y
Run Code Online (Sandbox Code Playgroud)
提示是:
Configuration file /etc/package-name/package-name.conf
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : background this process to examine the situation
The default action is …Run Code Online (Sandbox Code Playgroud)