我知道如何通过以下语法执行远程bash脚本:
curl http://foo.com/script.sh | bash
Run Code Online (Sandbox Code Playgroud)
要么
bash < <( curl http://foo.com/script.sh )
Run Code Online (Sandbox Code Playgroud)
这给出了相同的结果.
但是如果我需要将参数传递给bash脚本呢?脚本在本地保存时可能:
./script.sh argument1 argument2
Run Code Online (Sandbox Code Playgroud)
我试过这样的几种可能性,没有成功:
bash < <( curl http://foo.com/script.sh ) argument1 argument2
Run Code Online (Sandbox Code Playgroud)