小编dan*_*mcc的帖子

运行bash脚本时自动确认?

我正在编写一个简单的 bash 脚本,该脚本可以按照我的需要配置新服务器。这没什么特别的,但它有望在未来为我节省很多时间。

如何防止出现这样的提示:

  You are about to add the following PPA to your system:
    Stable version of nginx.
    More info: https://launchpad.net/~nginx/+archive/stable
  Press [ENTER] to continue or ctrl-c to cancel adding it
Run Code Online (Sandbox Code Playgroud)

从脚本运行这样的命令时:

  sudo add-apt-repository ppa:nginx/stable 
  sudo apt-get update
  sudo apt-get -y install nginx
Run Code Online (Sandbox Code Playgroud)

是否有我可以设置的自动接受标志或类似的东西?

apt bash scripts automation

15
推荐指数
2
解决办法
2万
查看次数

标签 统计

apt ×1

automation ×1

bash ×1

scripts ×1