我写了一个shell脚本来安装一个软件。但它有交互式控制台。说,输入是/否。
命令:sudo ./downloaded_software.run
Shell 脚本将包含上述命令 (test.sh)
Response of a command:
----------------------------------------------------------------------------
Welcome to the Setup Wizard.
----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.
Core Files [y/N] :
像这样,要处理三个交互式响应(Y 、 Y 并按 [Enter])。我该怎么做?
最佳答案
(代表 OP 发布)。
我们可以在“静默”
模式下安装,称为“静默安装”。
sudo ./downloaded_software.run --mode unattended
这不会提示用户输入任何信息。
关于linux - 如何捕获 sudo 命令的交互响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43582204/