extract specific key value from json in bash if key matches

extract specific key value from json in bash if key matches

I have a json content (output.json)

I have a json content (output.json)

{"project": {"id": "A", "content": [{"name": "XYZ", "location": "Berlin", "comments":""}, {"name": "ABC", "location": "NewYork", "comments": "Hwllo"}, {"name": "DEF", "location": "Paris", "comments": "Success"}]}}

I would like to extract location key with value when name matches say ABC from the above json using bash or shell commands

I tried something like below which gives be content within curly braces. but not sure on searching specific key.

cat output.json | grep -o -e "{.*}"

Output expectations: if name matches ABC, get output as "location":"NewYork"

Any suggestions on processing further?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

JSON Tutorial For Beginners | What is JSON | Learning JSON with JavaScript

JSON Tutorial For Beginners | What is JSON | Learning JSON with JavaScript

What is JSON - JSON Parsing in Swift

What is JSON and how do you parse JSON in Swift? JSON stands for JavaScript Object Notation and it's a way to represent data in a standard way. Learn how to parse JSON in Swift using the Codable protocol. We take the response JSON data from a real API call and then parse it in Swift!

JavaScript | Convert JSON String to JSON Object

Convert JSON string to JSON object javascript. This tutorial is the purpose to explain the best ways and examples for convert JSON string to a JSON object.