Size: 723
Comment:
|
Size: 1017
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 26: | Line 26: |
'''test2.json''' {{{#!highlight javascript { "keyx":12, "keyz":"ddff", "arr":[1,2,3,4] } }}} |
|
Line 40: | Line 49: |
jq '.arr[2]' test2.json #output 3 |
|
Line 41: | Line 54: |
== Curl JSON replay example == {{{#!highlight bash curl http://api.icndb.com/jokes/random 2>/dev/null | jq '.value.joke' | sed s/\"//g }}} |
jq
jq is a lightweight and flexible command-line JSON processor.
Slackbuild
Change values
test.json
test2.json
Get value from key
Curl JSON replay example
1 curl http://api.icndb.com/jokes/random 2>/dev/null | jq '.value.joke' | sed s/\"//g