Replies: 2 comments 1 reply
-
If you convert it to a valid yaml list of path expressions: - .foo.bar.baz
- .foo.bar.boo
- .bar.foo Then you can use ireduce and eval: echo "foo.bar.baz
foo.bar.boo
bar.foo" | sed -e 's/^/- \./' | yq '.[] as $i ireduce({}; eval($i) = null)' |
Beta Was this translation helpful? Give feedback.
1 reply
-
Works, thanks @mikefarah! For anyone stumbling on this in the future who's interested - this is the command I'm now using:
Which will find all occurrences of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to be able to expand a flat list of yaml keys to a yaml structure, for example:
Input:
Output:
My use case for this is to extract a list of values from a helm chart and then generate a dummy values file for it, e.g.:
Is this maybe even possible already? I didn't see anything that would indicate so in the docs.
Beta Was this translation helpful? Give feedback.
All reactions