以非交互方式运行 rustup 的 curl-fetched 安装程序脚本

Chi*_*ani 7 linux ubuntu

我正在尝试自动化包括安装锈的东西

curl https://sh.rustup.rs -sSf | sh
Run Code Online (Sandbox Code Playgroud)

这是用户输入的交互和查询,可以从“1”、“2”或“3”中进行选择。

无法弄清楚,如何输入。

通常对于 apt-get,“-y”选项尝试捕获并输入提示。

不确定,卷曲是如何完成的。

我怎样才能做到这一点?

And*_*fré 16

要使安装无人值守,您可以运行

curl https://sh.rustup.rs -sSf | sh -s -- -y
Run Code Online (Sandbox Code Playgroud)

如果你是 ssh,你应该在前面添加 nohup 参数

使用该-s参数,您将 sh 设置为从标准输入读取命令,然后将 传递-y给 auto 接受选项

有关 sh 的更多信息,您可以查看手册页