mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-27 00:47:56 +00:00
v4.25.1
This commit is contained in:
parent
3fe9e55f36
commit
27a14ec188
@ -31,6 +31,29 @@ will output
|
||||
!!seq
|
||||
```
|
||||
|
||||
## type is an alias for tag
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
a: cat
|
||||
b: 5
|
||||
c: 3.2
|
||||
e: true
|
||||
f: []
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq '.. | type' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
!!map
|
||||
!!str
|
||||
!!int
|
||||
!!float
|
||||
!!bool
|
||||
!!seq
|
||||
```
|
||||
|
||||
## Set custom tag
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
|
@ -9,10 +9,12 @@ Note that versions prior to 4.18 require the 'eval/e' command to be specified.&#
|
||||
{% endhint %}
|
||||
|
||||
## Unique array of scalars (string/numbers)
|
||||
Note that unique maintains the original order of the array.
|
||||
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
- 1
|
||||
- 2
|
||||
- 1
|
||||
- 3
|
||||
- 2
|
||||
```
|
||||
@ -22,8 +24,8 @@ yq 'unique' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
- 1
|
||||
- 2
|
||||
- 1
|
||||
- 3
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user