jshn - how to parse json package

前端 未结 1 1366
小鲜肉
小鲜肉 2021-01-14 08:27

I was wondering how to easily parse json on openwrt?

I\'ve jhsn to parse json and this is my procedure (.sh script):

#download weather
wget \"api.ope         


        
相关标签:
1条回答
  • 2021-01-14 09:14

    following script do what I need

    #!/bin/sh
    
    . /usr/share/libubox/jshn.sh
    
    O=$(wget "api.openweathermap.org/data/2.5/weather?id=2172797&appid=44db6a862fba0b067b1930da0d769e98" -O -)
    
    json_load "$O"
    json_select wind
    json_get_var var1 speed
    echo "speed: $var1"
    

    More info @ http://eko.one.pl/forum/viewtopic.php?pid=157702#p157702

    0 讨论(0)
提交回复
热议问题