Merge two files and print to stdout (v4+)

yq

  • A lightweight and portable command-line YAML processor.
    More information: <https://mikefarah.gitbook.io/yq/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

yq eval-all 'select(filename == "{{path/to/file1.yaml}}") * select(filename == "{{path/to/file2.yaml}}")' {{path/to/file1.yaml}} {{path/to/file2.yaml}}

click the source code to copy install yq on any operating system with command-not-found.com