mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-14 07:08:06 +00:00
8 lines
229 B
Bash
8 lines
229 B
Bash
|
#!/bin/bash
|
||
|
# ./yq ea '.[]' examples/data*.yaml
|
||
|
|
||
|
|
||
|
./yq ea '
|
||
|
((.[] | {.name: .}) as $item ireduce ({}; . * $item )) as $uniqueMap
|
||
|
| ( $uniqueMap | to_entries | .[]) as $item ireduce([]; . + $item.value)
|
||
|
' examples/data*.yaml
|