|
Size: 832
Comment:
|
← Revision 13 as of 2026-04-05 11:48:41 ⇥
Size: 1529
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| <<TableOfContents(2)>> |
|
| Line 5: | Line 7: |
| {{{#!highlight bash | {{{#!highlight sh |
| Line 49: | Line 51: |
jq '.arr[2]' test2.json #output 3 cat test2.json | jq '.data' | sed 's/\"//g' |
|
| Line 50: | Line 59: |
== Curl JSON replay example == {{{#!highlight sh curl http://api.icndb.com/jokes/random 2>/dev/null | json_reformat }}} {{{#!highlight javascript { "type": "success", "value": { "id": 55, "joke": "Most people have 23 pairs of chromosomes. Chuck Norris has 72... and they're all poisonous.", "categories": [ ] } } }}} {{{#!highlight bash curl http://api.icndb.com/jokes/random 2>/dev/null | jq '.value.joke' | sed s/\"//g curl https://www.tronalddump.io/random/quote 2>/dev/null | jq ".value" | 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 | json_reformat
