Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 581

jq to update key:value objects with matching strings at the begining

$
0
0

I need to update below json file values where key matches a substring.sample.json

{"A": "a""re": {"jok/pok": ^20.0,"sok/dok": ^23.0,"jok/ssd": ^32.0}}

now I need to append -dev to those key/values where key starts with jok.

{"A": "a""re": {"jok/pok": ^20.0-dev,"sok/dok": ^23.0,"jok/ssd": ^32.0-dev}}

I know I'm missing some really simple solution.


Viewing all articles
Browse latest Browse all 581

Trending Articles