Replies: 4 comments 1 reply
-
This is what I can come up with for now. Using echo '{"a":null}' | jq --arg e "$(cat file.txt)" '.a = $e' | yq e -P - I am sure this can be improved upon :) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
And if you want to keep the trailing newlines then:
(Note that this is a two line command) |
Beta Was this translation helpful? Give feedback.
-
I was having trouble with this issue, merging into an existing yaml. I had to paste a PEM into a Kubernetes CR. It worked fine in yq3. I originally had this:
Using the export command. It worked, but it put my multi-line content all on one line, rather than a yaml multi-line block. As above - what worked was this:
Can I suggest this goes in the documentation? |
Beta Was this translation helpful? Give feedback.
-
Hi helpful ppl,
Say I want create the following yaml
where them lines are coming from a file,
file.txt
is this possible?
Beta Was this translation helpful? Give feedback.
All reactions