Alternative for jq in debian wheezy to parse json in bash
jq is in Wheezy backports, and slated for Jessie
For backports on Wheezy, add the following to /etc/apt/sources.list (or a file to sources.d/???.list)
deb http://http.debian.net/debian wheezy-backports main
Then:
apt-get -t wheezy-backports install jq
Another alternative:
python -m json.tool file.json
One CLI json parser is jshon. Here is a simple example:
$ jshon -e foo -u <<< '{ "foo":"bar" }'
bar
The -e
options extract values from the json and the -u
decodes the final string.