Проверяя файл скрипта, вы можете использовать опцию -y
:
% sh <(curl https://sh.rustup.rs -sSf) -h
rustup-init 1.18.3 (302899482 2019-05-22)
The installer for rustup
USAGE:
rustup-init [FLAGS] [OPTIONS]
FLAGS:
-v, --verbose Enable verbose output
-y Disable confirmation prompt.
--no-modify-path Don't configure the PATH environment variable
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--default-host <default-host> Choose a default host triple
--default-toolchain <default-toolchain> Choose a default toolchain to install
--default-toolchain none Do not install any toolchains
Чтобы добавить -y
в качестве аргумента в этот конвейер, используйте sh
параметр-s
:
curl https://sh.rustup.rs -sSf | sh -s -- -y
-s
указывает sh
читать команды из ввода, а --
передает оставшиеся аргументы сценарию (, считанному из ввода ), поэтому -y
устанавливается в качестве аргумента сценария.
Или, если у вас есть bash, используйте подстановку процесса:
sh <(curl https://sh.rustup.rs -sSf) -y