mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-15 07:38:14 +00:00
52 lines
484 B
Markdown
52 lines
484 B
Markdown
# Min
|
|
|
|
Computes the minimum among an incoming sequence of scalar values.
|
|
|
|
## Minimum int
|
|
Given a sample.yml file of:
|
|
```yaml
|
|
- 99
|
|
- 16
|
|
- 12
|
|
- 6
|
|
- 66
|
|
```
|
|
then
|
|
```bash
|
|
yq 'min' sample.yml
|
|
```
|
|
will output
|
|
```yaml
|
|
6
|
|
```
|
|
|
|
## Minimum string
|
|
Given a sample.yml file of:
|
|
```yaml
|
|
- foo
|
|
- bar
|
|
- baz
|
|
```
|
|
then
|
|
```bash
|
|
yq 'min' sample.yml
|
|
```
|
|
will output
|
|
```yaml
|
|
bar
|
|
```
|
|
|
|
## Minimum of empty
|
|
Given a sample.yml file of:
|
|
```yaml
|
|
[]
|
|
```
|
|
then
|
|
```bash
|
|
yq 'min' sample.yml
|
|
```
|
|
will output
|
|
```yaml
|
|
```
|
|
|