-2

这是一个寻找除了以下三个之外的不同语法的问题:

curl https://sdk.cloud.google.com | bash -s arg1 arg2
curl https://sdk.cloud.google.com | bash /dev/stdin arg1 arg2
bash <( curl https://sdk.cloud.google.com ) arg1 arg2

用于将参数传递给通过 curl 获取的脚本......因为列出的所有gcloud脚本都不能与我试图以静默方式安装到 VM 上的脚本一起使用。

我已经研究过这些,但没有找到第 4 种替代方法来尝试:

4

1 回答 1

1

回过头来,原来是一个非常小众的答案,因为来自谷歌支持的人提供了这种语法:

export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl -s https://sdk.cloud.google.com | bash &>/tmp/gcloud_install_$(date +%Y%m%d%H%M).log

于 2015-05-04T10:38:36.957 回答