Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator to apply string interpolation on value similar to envsubst #2123

Open
jedvardsson opened this issue Aug 7, 2024 · 0 comments
Open

Comments

@jedvardsson
Copy link

I suggest to add an operator similar to envsubst to explicitly invoke the new string interpolation feature on a value.

For example,

color: green
fruit: '\(color) apple'
yq '.fruit |= interpolate' sample.yaml

Could output

color: green
fruit: 'green apple'

Note that the uninterpolated cannot use double quotes since \( is not a valid escape sequence.

Here is an example using envsubst:

fruit: '${color} apple'
color=green yq '.fruit |= envsubst' sample.yaml

outputs

fruit: 'green apple'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant