Вы можете использовать подстановку процесса и перенаправить полученный скрипт на стандартный ввод Bash:
$ bash -s 'first argument' 'second argument' < <(echo 'printf "%s\n" "$@"')
first argument
second argument
Замените команду echo
на curl
, и все готово.
Изman bash
:
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.