json processor jq for a package.json
{
"someparent" : {
"somechild" : "oldvalue"
}
}
If I run the following command (to change oldvalue
to somevalue
):
jq '.someparent["somechild"] = "somevalue" "$aDirection/package.json"'
It is successfully changed. However, if I give a variable instead of someValue
:
aVar="anotherValue"
jq '.someparent["somechild"] = "$aVar" "$aDirection/package.json"'
It is not working. What I already tried:
["aVar"] #interpreted as string
["$aVar"] #interpreted as string
"$aVar" # aVar is not defined
$avar #aVar is not defined