This commit is contained in:
Mike Farah
2021-12-04 13:25:32 +11:00
parent 055e441686
commit 2f05f7390f
7 changed files with 168 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
## Sort by string field
Given a sample.yml file of:
```yaml
- a: banana
- a: cat
- a: apple
```
then
```bash
yq eval 'sort_by(.a)' sample.yml
```
will output
```yaml
- a: apple
- a: banana
- a: cat
```