We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$ yq --version yq (https://github.com/mikefarah/yq/) version v4.40.5 $ echo 'simple: string0 simpleArray: - apple - banana - peach deep: property: value array: - cat' | yq '.. |( ( select(kind == "scalar" and parent | kind != "seq") | (path | join("_")) + "='" + . + "'"), ( select(kind == "seq") | (path | join("_")) + "=(" + (map("'" + . + "'") | join(",")) + ")") )' simple= + . + deep_property= + . + simpleArray=( + . + , + . + , + . + ) deep_array=( + . + )
I believe this is caused by wrong escaping. If you use single quote to quote the string, you need to escape single quotes inside...
The text was updated successfully, but these errors were encountered:
Yes you're absolutely right - it should be:
yq '.. |( ( select(kind == "scalar" and parent | kind != "seq") | (path | join("_")) + "='\''" + . + "'\''"), ( select(kind == "seq") | (path | join("_")) + "=(" + (map("'\''" + . + "'\''") | join(",")) + ")") )' test.yaml
I'll update the docs 👍🏼
Sorry, something went wrong.
Need to escape single quotes in bash, updated docs #1932
6e21c9f
461bb9c
No branches or pull requests
I believe this is caused by wrong escaping.
If you use single quote to quote the string, you need to escape single quotes inside...
The text was updated successfully, but these errors were encountered: