мда
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
|
||||
run: |
|
||||
echo '[
|
||||
{"first": "first ok"},
|
||||
{"second": "second ok"},
|
||||
{"third": "third ok"},
|
||||
{"fourth": "fourth ok"},
|
||||
{"fifth": "fifth ok"}
|
||||
]' > test.json
|
||||
echo "all"
|
||||
jq '.[].first // .[].second // .[].third // .[].fourth // .[].fifth' test.json
|
||||
echo "only object third"
|
||||
jq '.[] | select(has("third"))' test.json
|
||||
echo "only fourth"
|
||||
jq '.[3].fourth' test.json
|
||||
echo '[
|
||||
{"first": "first ok"},
|
||||
{"second": "second ok"},
|
||||
{"third": "third ok"},
|
||||
{"fourth": "fourth ok"},
|
||||
{"fifth": "fifth ok"}
|
||||
]' > test.json
|
||||
echo "all"
|
||||
jq '.[].first // .[].second // .[].third // .[].fourth // .[].fifth' test.json
|
||||
echo "only object third"
|
||||
jq '.[] | select(has("third"))' test.json
|
||||
echo "only fourth"
|
||||
jq '.[3].fourth' test.json
|
||||
Loading…
Add table
Add a link
Reference in a new issue