3 ms·
That is why you use jq --arg for the input instead of crafting it by string concatenation. data=$(jq -n \ --arg title 'what"ever' \
by _wolfie_ 5y ago
That is why you use jq --arg for the input instead of crafting it by string concatenation.
data=$(jq -n \
--arg title 'what"ever' \
--arg endpoint 'foo"bar' \
'{
"title": $title,
"endpoint": $endpoint,
"enabled": true
}')
- aesyondu 5y agoI use jq exclusively for parsing output. Didn't know you could craft JSON with jq as well. Thanks for the tip!