Home

Awesome

json.sh

Pure-POSIX-shell JSON parser.

Example

Suppose tests/mixed.json contains the following (it does):

{
	"foo": ["bar", "baz"],
	"asdf": {
		"qwerty": 47
	}
}

Running json.sh <"tests/mixed.json" yields:

/foo/0 string bar
/foo/1 string baz
/asdf/qwerty number 47

Installation

make && sudo make install

Usage

From the command-line:

json.sh <"tests/mixed.json"

As a library:

. "lib/json.sh"
json <"tests/mixed.json"

Overriding the default use of / as the key separator:

JSON_SEPARATOR="^" json.sh <"tests/mixed.json"

TODO

TODONE

License

json.sh is BSD-licensed.