jq を更新

syui 2024-03-03 17:14:30 +00:00
parent 7495bab324
commit 5900596038

31
jq.md

@ -1 +1,30 @@
example
## null
`id:3``name:null`を除外して表示
```json
[
{
"id": 1,
"name": "aios",
"display": "ai os"
},
{
"id": 2,
"name": "archlinux",
"display": "Arch Linux"
},
{
"id": 3,
"display": "Linux Kernel"
}
]
```
```sh
$ echo $json|jq -r ".[]|{name, display}|select(.name | length > 0)|.name,.display"
aios
ai os
archlinux
Arch Linux
```