1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00
yq/pkg/yqlib/doc/Anchor Operators.md
2020-12-22 11:57:41 +11:00

321 B

Get anchor

Given a sample.yml file of:

a: &billyBob cat

then

yq eval '.a | anchor' sample.yml

will output

billyBob

Set anchor name

Given a sample.yml file of:

a: cat

then

yq eval '.a anchor = "foobar"' sample.yml

will output

a: &foobar cat