This is very similar to Prevent bash from adding single quotes to variable output, but none of those answers are helping me.
This script:
set -ex
curl_headers=(
--silent
"--form release_description=$'\n new \n'"
)
curl "${curl_headers[@]}" "example.com"
Returns this output:
+ curl_headers=(--silent "--form release_description=$'\n new \n'")
+ curl --silent '--form release_description=$'\''\n new \n'\''' example.com
It's doing two things I don't want. It's adding a single tick before --form
and it's escaping the single ticks in my release_description
The desired result is:
curl --silent --form release_description=$'\n new \n' example.com
How do I get it to remove the escape sequences and added single ticks?