I know how to execute remote Bash scripts like this:
curl http://example.com/script.sh | bash
or
bash < <( curl http://example.com/script.sh )
which give the same result.
But what if I need to pass arguments to the bash script? It's possible when the script is saved locally:
./script.sh argument1 argument2
I tried several possibilities like this one, without success:
bash < <( curl http://example.com/script.sh ) argument1 argument2
try
curl http://foo.com/script.sh | bash -s arg1 arg2
bash manual says:
If the -s option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an interactive shell.