解析帶 - 名稱
echo { \"host\": \"host\", \"host-name\": \"host-name\" } |jq '.["host-name"]'
jsan.txt
{
"result": {
"host": "host", "host-name": "host-name0"
},
"host": "host", "host-name": "host-name1"
}
cat jsan.txt | jq '.["host-name"]'
cat jsan.txt | jq '.result["host-name"]'
cat jsan.txt | jq '.result["host-name"]'
沒有留言:
張貼留言