Reference:
https://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl/4642975
It is customary to use the following methods when executing scripts on a publishing machine:
Curl Http://example.com/script.sh | Bash
If an incoming parameter is involved, you can use the
1. Curl Http://example.com/script.sh | Bash-s arg1 Arg22. Curl Http://example.com/script.sh | Bash/dev/stdin arg1 arg23. Bash < (Curl http://example.com/script.sh) arg1
If you have "-" in the parameter, you can use the long option "--" to resolve
Curl Http://example.com/script.sh | Bash-s--Arg1 arg2
If the parameter is "-p blah-d blah", you can use the following command to perform
Curl Http://example.com/script.sh | Bash-s---P blah-d blah
Not only the input of curl, but also the input of other methods. The following examples can be used to understand further
Echo ' I=1; For a in [email protected]; Do echo "$i = $a"; i=$ ((i+1)); Done ' | Bash-s---a1-a2-a3--long Some_text
Curl way to execute script simultaneous parameter issues