@somenxavier In general I would suggest asking followup questions as their own separate posts, not as comments. But since this one is quick, I'll tell you that it's because
$md
is part of a string, and variables are not interpolated in strings in jq. You need to mark interpolation sequences explicitly with \(...)
. Try jq --arg md "foo" '. += {'content': "\($md)"}' blog.json
to see interpolation in action, or jq --arg md "foo" '. += {'content': $md}' blog.json
to see how to reference the variable $md
directly.