Skip to content

Instantly share code, notes, and snippets.

@bartoszm
Last active June 10, 2021 14:43
Show Gist options
  • Save bartoszm/5141063078a2073d449c08dcaaa94856 to your computer and use it in GitHub Desktop.
Save bartoszm/5141063078a2073d449c08dcaaa94856 to your computer and use it in GitHub Desktop.
Remove all nodes from YAML matching the pattern (name starts from '@)
yq -w 250 -Y -i '[(paths | select(.[-1] | tostring | test("^@")))] as $paths | delpaths($paths)' <<file>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment