LinuxCommandLibrary

jshon

TLDR

Extract key

$ echo '{"name":"test"}' | jshon -e name
copy
Get array element
$ echo '[1,2,3]' | jshon -e 0
copy
Get string value
$ echo '{"name":"test"}' | jshon -e name -u
copy
Get type
$ echo '[1,2,3]' | jshon -t
copy
Array length
$ echo '[1,2,3]' | jshon -l
copy
Iterate array
$ echo '[1,2,3]' | jshon -a
copy

SYNOPSIS

jshon [options]

DESCRIPTION

jshon parses JSON in shell scripts. It provides simple extraction and manipulation primitives.
The tool chains operations for complex queries. It's designed for shell pipeline integration.
jshon parses JSON for shell.

PARAMETERS

-e KEY

Extract key or index.
-u
Unpack string value.
-t
Show type.
-l
Show length.
-a
Iterate over array.
-s STRING
Create string.
--help
Display help information.

CAVEATS

C-based tool. Chaining syntax. Consider jq for complex queries.

HISTORY

jshon was created as a shell-friendly JSON parser with a pipeline-oriented interface.

SEE ALSO

jq(1), jo(1), json_pp(1)

Copied to clipboard