projects
/
openwrt.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
ramips: setup GPIO chip functions on the fly
[openwrt.git]
/
package
/
jshn
/
example.txt
1
. /lib/functions/jshn.sh
2
3
# generating json data
4
json_init
5
json_add_string "msg" "Hello, world!"
6
json_add_object "test"
7
json_add_int "testdata" "1"
8
json_close_object
9
MSG=`json_dump`
10
# MSG now contains: { "msg": "Hello, world!", "test": { "testdata": 1 } }
11
12
13
# parsing json data
14
json_load "$MSG"
15
json_select test
16
json_get_var var1 testdata
17
json_select ..
18
json_get_var var2 msg
19
echo "msg: $var2 - testdata: $var1"
This page took
0.044435 seconds
and
5
git commands to generate.