[GRLUG] JSON parsing from bash

megadave megadave at gmail.com
Wed Nov 2 00:55:47 EDT 2011


Anyone have any familiarity with JSON?

I'm trying to make some automated queries to a device which returns
the results in JSON form.

I'm trying to find a way to flatten the JSON data, eg

Eg, for something like this:

{
"foo" : "bar",
"beep" : 67,
"snizz" : {
"bit" : 5,
"lit" : 7,
"bat" " 23
},
"neep" : {
"bit" : "red",
"bat" : "blue",
"cat" : 34
},
}

I'd love to have a util that would give me:

foo:bar
beep:67
snizz.bit:5
snizz.lit:7
snizz.bat:23
neep.bit:red
neep.bat:blue
neep.cat:34

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the grlug mailing list