Skip to content

Merging file without changing array value #836

Answered by steenstra
steenstra asked this question in Q&A

You must be logged in to vote

Using version 4, I've resolved the issue with the following command:

docker run --rm -v "${PWD}":/workdir mikefarah/yq:latest 
eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' b.yaml a.yaml

It was not very clear from the upgrade guide that the arguments have become reversed in this version, so that b.yaml is overwritten by a.yaml.

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by mikefarah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant