Hi
Im checking inside a openwrt to see If is possible to filter json string to have the values.
For example {"address":"192.168.2.2","user":"user1","groups":"permissions"}
I receive from curl the string and I need to separate values to pass vars to other commands.
For now Im checking some examples but not works
#!/bin/sh
. /usr/share/libubox/jshn.sh
json_init
json_load '$(cat $STRING)'
json_get_keys keys
for k in $keys; do
json_get_var v "$k"
echo "$k : $v"
done
But produce error "Failed to parse message data"
My problem is justly that I can't use jq, or python to choose data, so I think the solution is to separate first and send to vars every value, making something usable. I was checking jshn and jsonfilter utilities but for this type of json not seems to work.
Suggestions?