мда
This commit is contained in:
parent
55f7c557c8
commit
54ad2850ab
1 changed files with 13 additions and 13 deletions
|
|
@ -28,16 +28,16 @@ jobs:
|
||||||
|
|
||||||
- name: run jq
|
- name: run jq
|
||||||
run: |
|
run: |
|
||||||
echo '[
|
echo '[
|
||||||
{"first": "first ok"},
|
{"first": "first ok"},
|
||||||
{"second": "second ok"},
|
{"second": "second ok"},
|
||||||
{"third": "third ok"},
|
{"third": "third ok"},
|
||||||
{"fourth": "fourth ok"},
|
{"fourth": "fourth ok"},
|
||||||
{"fifth": "fifth ok"}
|
{"fifth": "fifth ok"}
|
||||||
]' > test.json
|
]' > test.json
|
||||||
echo "all"
|
echo "all"
|
||||||
jq '.[].first // .[].second // .[].third // .[].fourth // .[].fifth' test.json
|
jq '.[].first // .[].second // .[].third // .[].fourth // .[].fifth' test.json
|
||||||
echo "only object third"
|
echo "only object third"
|
||||||
jq '.[] | select(has("third"))' test.json
|
jq '.[] | select(has("third"))' test.json
|
||||||
echo "only fourth"
|
echo "only fourth"
|
||||||
jq '.[3].fourth' test.json
|
jq '.[3].fourth' test.json
|
||||||
Loading…
Add table
Add a link
Reference in a new issue