How can I pretty-print JSON in a shell script?
04:51 09 Dec 2008

Is there a (Unix) shell script to format JSON in human-readable form?

Basically, I want it to transform the following:

{ "foo": "lorem", "bar": "ipsum" }

... into something like this:

{
    "foo": "lorem",
    "bar": "ipsum"
}
json unix command-line format pretty-print