我正在编写一个简单的 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)
是否有我可以设置的自动接受标志或类似的东西?