I have figured out how to set a value in my JSON file, package.json, using setpath
. Can I do this using a pattern?
cat package.json | jq 'setpath(["dependencies", "acme-a"]; "mytagname")'
What I would like to do is use a pattern like the following so it also sets the paths at "acme-b", "acme-c", and so on:
cat package.json | jq 'setpath(["dependencies", "acme-*"]; "mytagname")'
Does jq support that, and if so, how is it accomplished?