Skip to content

Instantly share code, notes, and snippets.

@latermonk
Created March 20, 2024 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save latermonk/119e4251c90e4cdccc544d2884d605cf to your computer and use it in GitHub Desktop.
Save latermonk/119e4251c90e4cdccc544d2884d605cf to your computer and use it in GitHub Desktop.
Yq
```bash
# Read the key-value pair from source.yaml and store it in a variable
value=$(yq e '.key' source.yaml)
# Update target.yaml with the value from source.yaml
yq e ".key = \"$value\"" -i target.yaml
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment