我知道如何執行遠程bash腳本提取腳本時打壞,經由這些語法:傳遞參數執行由捲曲
curl http://foo.com/script.sh | bash
或
bash < <(curl http://foo.com/script.sh)
其中給出相同的結果。
但是如果我需要將參數傳遞給bash腳本呢?這是可能的,當腳本保存在本地:
./script.sh argument1 argument2
我嘗試了幾種可能性,像這樣的,沒有成功:
bash < <(curl http://foo.com/script.sh) argument1 argument2
謝謝!非常有用的要點:) – 2011-01-10 01:37:05
如果arg1是一個簡短的arg,則不要工作:curl http://foo.com/script.sh | bash -s -y – Xorax 2012-10-26 17:40:22
那些使用像`-p blah -d blah`這樣的鍵的參數呢? – CMCDragonkai 2014-05-15 06:21:46