Bash parse json file. I need to get the version value from a json file shich looks like this :
{
"attributes": {
},
"groupings": {
},
"recipes": {
},
"version": "0.2.54",
"source_url": "",
"issues_url": ""
}
But on other servers it look like this (without spaces)
"attributes": {},"groupings": {},"recipes":{},"version": "0.2.54","source_url": "","issues_url": ""}
I tried solving this with "grep -Po" but wouldn't work on the jsons without spaces and than trying to solve this with sed&awk but wouldn't work on jsons with spaces. Is there another way to do this noting that I'm trying to use this in a script and connecting to servers with "knife ssh"