skip to Main Content

Json – Update fields from string in JQ

I have a bash $string containing the values: abc,def and a file.json looking like this: [ { "loc": "51.12345, 12.12345", "city": "CityName1" }, { "loc": "65.12345, 15.12345", "city": "CityName2" } ] I'm trying to update the city field with the…

VIEW QUESTION

Json – get a value with jq by matching one of parent value from a variable

I have JSON data as below, in services.json { "checkout-serviceA":{"prId":6644,"Sourcebranch":"","HFX":false,"IS_CR":"Yes"}, "checkout-serviceB":{"prId":15826,"Sourcebranch":"","HFX":false,"IS_CR": "no"}, "checkout-toggle":{"prId":8963,"Sourcebranch":"","HFX":true,"IS_CR": "Yes"}, "checkout-res":{"prId":1104,"Sourcebranch":"","HFX":false,"IS_CR": "Yes"} } I have a variable eg $PRID that contains prID value already. I want to pass this to jq and fetch or get an…

VIEW QUESTION
Back To Top
Search