一連のサーバーに接続し、特定のパッケージを更新する単純なbashスクリプトがあり、here-stringを使用してプロンプトに応答します。
sudo /usr/bin/apt-get install package-name <<< Y
プロンプトは次のとおりです。
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 to keep your current version.
*** package-name.conf (Y/I/N/O/D/Z [default=N] ?
これは、機能しない場合のエラーです。
dpkg: error processing package-name (--configure):
EOF on stdin a conffile prompt
Errors were encountered while processing:
package-name
サーバーにexpectまたはその他のプログラムをインストールできません。どんな助けでもいただければ幸いです。