Как я могу отправить команду как следующее, но с параметрами по умолчанию (без ввода данных пользователем). Я хочу использовать это в сценарии оболочки.
dpkg --configure -a ...
==> Modified (by you or by a script) since installation. ==> Package
distributor has shipped an updated version. 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 : start a shell to examine the situation The default action is to keep your current version.
*** CONFIGFILE (Y/I/N/O/D/Z) [default=N] ? ^C
Это - задание для yes
, если Вы всегда хотите ответ N :
yes N | dpkg --configure -a
Или Y (работает без аргумента):
yes | dpkg --configure -a
Или по эти dpkg
опции, см. dpkg --force-help
:
[...]
[!] confnew Always use the new config files, don't prompt
[!] confold Always use the old config files, don't prompt
[!] confdef Use the default option for new config files if one
is available, don't prompt. If no default can be found,
you will be prompted unless one of the confold or
confnew options is also given
[...]
Использование затем (например):
dpkg --configure -a --force-confnew