-
|
Hello! I am using shell and yq (version 4.17.2) to update a yml file. I have posted my question on stackoverflow but I am also posting it here in hopes of finding an answer. https://stackoverflow.com/questions/70932362/use-yq-to-update-array-value |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
|
Below is my stackoverflow post: I have two yaml files I am using. The first yaml file looks like this: spring.yml I have another file that just contains routes and looks like this: routes.yml My goal is to update the route in the first file with the value of the route in the second file. Note that the first file in reality will have many routes but for demonstration purposes I am only showing the first in this example. I have the following script which loops through to update the routes as necessary when the id's match: My assumption is this command should update spring.yml file with the new route in place of the one that was identified with the same id: But I am getting the following error I'm stumped on this and not sure what I'm doing wrong at this point. For reference I am using yq version 4.17.2. |
Beta Was this translation helpful? Give feedback.
Below is my stackoverflow post:
I have two yaml files I am using. The first yaml file looks like this:
spring.yml
I have another file that just contains routes and looks like this:
routes.yml
My goal is to update the route in the first file with the value of the route in the second file. Note that the first file in reality will have many routes but for demonstration purposes I am only showing the f…