命令行解析json

1
2
3
4
5
6
7
8
9
10
{
"data": [
{
"name":"a1"
},
{
"name":"a2"
}
]
}
1
2

jq -r '.data[].name'

-r raw, 直接打印文本, 而不是json格式

https://www.jianshu.com/p/6de3cfdbdb0e

https://www.cnblogs.com/angle6-liu/p/10580792.html

https://github.com/stedolan/jq/wiki/For-JSONPath-users

0%