yq
is quite different from previous versions (and I apologise for that) - however it will be very familiar if you have used jq
before as it now uses a similar syntax. Most commands that you could do in v3
are longer in v4
as a result of having a more expressive syntax language.v4
by default now:v3
yq had seperate commands for reading/writing/deleting and more. In v4
all these have been embedded into a single expression you specify to either the eval
command (which runs the expression against each yaml document for each file given in sequence) or the eval-all
command, which reads all documents of all files, and runs the given expression once.v3
have been put into the expression language, for instance stripComments
allowing you to specify which nodes to strip comments from instead of only being able to apply the flag to the entire document.jq
, merge is done via the multiply operator. You will need to use the eval-all command to load all documents into memory at once, and then use the file operator to select the file nodes to merge.yq
to run through the expression pipeline - for what it's worth, this is what jq
does as well. Instead use the --null-input/-n
flag and pipe out the results to the file you want directly (see example below).v3
so expect to see more features soon!