curl http://testhost.test.com:8080/application/app/version | jq \'.version\' | jq \'.[]\'
The above command outputs only the values as below:
Here's another way of getting a Bash array with the example JSON given by @anubhava in his answer:
arr=($(jq --raw-output 'keys_unsorted | @sh' file.json)) echo ${arr[0]} # 'Archiver-Version' echo ${arr[1]} # 'Build-Id' echo ${arr[2]} # 'Build-Jdk'