传递参数给bash -c shell脚本



我需要在cloud shell上执行shell脚本。我使用curl命令从云存储下载shell脚本然后尝试执行相同的

/bin/bash -c "$(curl -fsSL https://storage.googleapis.com/<Some_bucket>/rules.sh)"

我需要传递2个参数到这个脚本rules.sh.

我尝试了以下两种方法:

/bin/bash -c "$(curl -fsSL https://storage.googleapis.com/<Some_bucket>/rules.sh)" param1 param2

/bin/bash -c "$(curl -fsSL https://storage.googleapis.com/<Some_bucket>/rules.sh) param1 param2"

但这两种方法都不起作用。

让我知道我应该如何传递参数?

curl -fsSL https://storage.googleapis.com/<Some_bucket>/rules.sh | bash -s param1 param2

最新更新