contents="$(jq ".name = \"$writefrom_caproj_name\"" "$manifestwebapp_absolute_path")" && \
# credits from https://linuxconfig.org/string-concatenation-in-bash
echo "${contents}" > manifest.webapp
Special attention to this part:
"$(jq ".name = \"$writefrom_caproj_name\"" "$manifestwebapp_absolute_path")"
It simply doesn't works, as "$manifestwebapp_absolute_path"
is using quotes inside quotes.
And using \"$manifestwebapp_absolute_path\"
results in escaping the quotes BUT is also printing them.
So, how to use quotes inside quotes, somewhat like escaping them but without printing'em out?
Many thanks in advance! π
Note: with proper answers turning into a solution, this question will be later turned into an explanation post.
Top comments (1)
Something is ringing a bell and I am wondering if this might solve your problem:
Have you tried using single quotes to wrap what you want contents to be set to?