How to splat an env(<ARRAY>)? #2069
-
I've tried different syntax to splat an env() and feel like I'm missing something. Examples: Not working list='["item1", "item2", "item3"]' yq --null-input 'env(list)[]' # returns Error: bad expression, please check expression syntax
list='["item1", "item2", "item3"]' yq --null-input '[env(list)][]' # nests the array in an array then splats the second level, returning me to where I began Working: list='["item1", "item2", "item3"]' yq --null-input 'env(list) | .[]' # pipe then splat
list='["item1", "item2", "item3"]' yq --null-input '[env(list)][][]' # double splat after nesting edit: list='["item1", "item2", "item3"]' yq --null-input 'env(list) as $list | $list[]' I guess I'm trying to understand if the Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I just haven't added |
Beta Was this translation helpful? Give feedback.
Fixed in v4.44.2