In Bash shell script, I want to extract an object. For example, with following json file, I would like to extract dependencies
object and it should return me: "dmg": ">= 0.0.0", "build-essential": ">= 0.0.0", "windows": ">= 0.0.0"
in whatever format and how do you do that?
// My data 1.json:
{
"platforms": {
"amazon": ">= 0.0.0",
"arch": ">= 0.0.0",
"centos": ">= 0.0.0",
"debian": ">= 0.0.0"
},
"dependencies": {
"dmg": ">= 0.0.0",
"build-essential": ">= 0.0.0",
"windows": ">= 0.0.0"
},
"recommendations": {}
}
// My data 2.json:
{
"platforms": {
"amazon": ">= 0.0.0",
"arch": ">= 0.0.0",
"centos": ">= 0.0.0",
"debian": ">= 0.0.0"
},
"recommendations": {},
"dependencies": {
"dmg": ">= 0.0.0",
"build-essential": ">= 0.0.0",
"windows": ">= 0.0.0"
}
}
// My data 3.json:
{
"dependencies": {
"dmg": ">= 0.0.0",
"build-essential": ">= 0.0.0",
"windows": ">= 0.0.0"
},
"platforms": {
"amazon": ">= 0.0.0",
"arch": ">= 0.0.0",
"centos": ">= 0.0.0",
"debian": ">= 0.0.0"
},
"recommendations": {}
}
// My data 4.json:
{
"dependencies": {
"dmg": ">= 0.0.0",
"build-essential": ">= 0.0.0",
"windows": ">= 0.0.0"
}
}
// My data 5.json (compress):
{"dependencies":{"dmg":">= 0.0.0","build-essential":">= 0.0.0","windows":">= 0.0.0"},"platforms":{"amazon":">= 0.0.0","arch":">= 0.0.0","centos":">= 0.0.0","debian":">= 0.0.0"},"recommendations":{}}