mirror of
https://github.com/mikefarah/yq.git
synced 2025-02-05 07:57:11 +00:00
v4.25.1
This commit is contained in:
parent
3fe9e55f36
commit
27a14ec188
@ -31,6 +31,29 @@ will output
|
|||||||
!!seq
|
!!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
|
## Set custom tag
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -9,10 +9,12 @@ Note that versions prior to 4.18 require the 'eval/e' command to be specified.&#
|
|||||||
{% endhint %}
|
{% endhint %}
|
||||||
|
|
||||||
## Unique array of scalars (string/numbers)
|
## Unique array of scalars (string/numbers)
|
||||||
|
Note that unique maintains the original order of the array.
|
||||||
|
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
```yaml
|
```yaml
|
||||||
- 1
|
|
||||||
- 2
|
- 2
|
||||||
|
- 1
|
||||||
- 3
|
- 3
|
||||||
- 2
|
- 2
|
||||||
```
|
```
|
||||||
@ -22,8 +24,8 @@ yq 'unique' sample.yml
|
|||||||
```
|
```
|
||||||
will output
|
will output
|
||||||
```yaml
|
```yaml
|
||||||
- 1
|
|
||||||
- 2
|
- 2
|
||||||
|
- 1
|
||||||
- 3
|
- 3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user