Is it possible to parse only "version":"8.9" from json file
Provided, the json
is properly closed, like
{
"version": "8.9",
"description": "Long-Term Support version - Hardening for long-term reliability, bug fixes and small improvements",
"releaseDate": "2021-05-04",
"changeLogUrl": "https://jira.sonarsource.com/secure/ReleaseNote.jspa?projectId=10930&version=16710",
"downloadUrl": "https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.9.0.43852.zip",
"plugins": {
"requireUpdate": [
{
"key": "codehawk",
"name": "Codehawk Java",
"category": "External Analysers",
"description": "Analyze Java code smell",
"homepageUrl": "https://github.com/SDPMLab/CodeHawk",
"editionBundled": false,
"version": "1.5"
}
]
}
}
... you can use jq
:
jq -r '.version' data.json
You may need to install jq
:
sudo apt install jq