Skip to content
Pure-shell JSON parser
Find file
Latest commit 866b1ac Feb 12, 2013 @rcrowley (#2) Found a way to use POSIX sed(1) after all.
The limitation here is that your JSON can't contain ASCII record separator characters.

Pure-POSIX-shell JSON parser.


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

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

Running <"tests/mixed.json" yields:

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


make && sudo make install


From the command-line: <"tests/mixed.json"

As a library:

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

Overriding the default use of / as the key separator:

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


  • Whole-ass the half-assed escape sequence and Unicode support.


  • Arrays.
  • Booleans.
  • Objects.
  • null.
  • Numbers.
    • Floating-point.
    • Negative.
    • Scientific notation.
  • Strings.
    • Backspace, form feed, newline, and carriage return escapes.
    • Unicode characters specified by their codepoints: \uXXXX.

License is BSD-licensed.

Something went wrong with that request. Please try again.