Storing a List of Arguments
You build curl options in a variable: opts="-H 'X-Team: ops' --retry 3", then run curl $opts "$url". The header arrives broken. What's the robust approach?
opts="-H 'X-Team: ops' --retry 3"
curl $opts "$url"
Choose one answer
An array, expanded as "${opts[@]}".
"${opts[@]}"
Put the options in a file and use curl $(cat opts.txt) "$url".
curl $(cat opts.txt) "$url"
Use eval curl $opts "$url" so the quotes are interpreted.
eval curl $opts "$url"
Quote it as curl "$opts" "$url".
curl "$opts" "$url"