mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 10:04:43 +08:00
wip
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user