lmuserx4849 wrote:jq: Unknown option -Mr
Linux Mint 17.x has a very old version of jq but even if you are on that, it still supports those options according to the manual: http://manpages.ubuntu.com/manpages/tru ... /jq.1.html
If you are on Linux Mint 17.x you may want to install the Linux Mint 18.x version of jq, which is the most recent release version. You can download the needed files for your architecture from (follow the amd64 link for 64 bit and the i386 link for 32 bit):https://packages.ubuntu.com/xenial/libonig2https://packages.ubuntu.com/xenial/jq
After downloading double-click the .deb files in your file browser to install them. Install libonig2 before jq.
lmuserx4849 wrote:I tried: jq -M -r xulstore.json and jq xulstore.json
As per the manual you are missing a filter in those commands. I.e., what is your query on the json data? At minimum you need the dot filter (just match everything):
jq -M -r . xulstore.json
I recommend reading the documentation, at least the basic filters section, at https://stedolan.github.io/jq/manual/
. While you are narrowing down on the correct filter for your json data to get the information you need, you may want to not use the -M or -r options. -M makes output monochrome; that is friendly for scripts that parse jq output but less friendly for humans
Leave colors on until you put the finished command into a script. Same for -r option that disables json quoting of values. Handy for scripts but until you have finished your filter leave it in place.
lmuserx4849 wrote:I'd be interested in hearing about any tools of this type.
Specifically json tools? A common named alternative to jq is rq: https://github.com/dflemstr/rq
. I looked at it when I needed a tool that could handle optional elements, sort list elements and join them into a single line, and more. Wouldn't know how to start with that on rq but got it all working with jq's much more extensive documentation and examples.