Currently I am trying to exchange a string but WITH double quotes in a YAML file with the mikefarah/yq processor (version 3.1.2 on an Ubuntu machine) similar to the following:
config:
app:
name: "string"
So I tried to solve this classically for me first with:
yq w -i appconfig.yml config.app.name "exchangedstring"
But the quotation marks were not included in the string.
config:
app:
name: exchangedstring
I have made several attempts to escape the string to get the desired result, but unfortunately everything was not the desired result. For example, if I set the string to triple (something like """), the quotation marks were set, but then there was a single quote around it. It then looked like this:
config:
app:
name: '"exchangedstring"'
But my desired result would be like this:
config:
app:
name: "exchangedstring"
I also tried it with backslashes in different variations (example ""exchangedstring"" or '"exchangedstring"'). Unfortunately all the wrong result. I can't exclude the possibility that the application that will later parse the yaml file will not mess with the string at the position, so it is absolutely necessary for me that the string is in quotation marks at the position.
Does anybody have an idea how I can still get only a simple version of quotation marks in place?