Skip to content

Using environment variables as dynamic keys #764

Answered by mikefarah
mudideng asked this question in Q&A
Discussion options

You must be logged in to vote

Yep, you can do it using interpolation in your shell like you've done, or via the env operator documented here: https://mikefarah.gitbook.io/yq/operators/env-variable-operators#dynamic-key-lookup-with-environment-variable

Env operator is useful just because it sidesteps escaping and quoting issues in shells

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mudideng
Comment options

Answer selected by mudideng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants