mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 00:54:51 +08:00
Updating docs
This commit is contained in:
@@ -5,7 +5,7 @@ You can use subtract to subtract numbers, as well as removing elements from an a
|
||||
## Array subtraction
|
||||
Running
|
||||
```bash
|
||||
yq eval --null-input '[1,2] - [2,3]'
|
||||
yq --null-input '[1,2] - [2,3]'
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
@@ -15,7 +15,7 @@ will output
|
||||
## Array subtraction with nested array
|
||||
Running
|
||||
```bash
|
||||
yq eval --null-input '[[1], 1, 2] - [[1], 3]'
|
||||
yq --null-input '[[1], 1, 2] - [[1], 3]'
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
@@ -34,7 +34,7 @@ Given a sample.yml file of:
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval '. - [{"c": "d", "a": "b"}]' sample.yml
|
||||
yq '. - [{"c": "d", "a": "b"}]' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
@@ -51,7 +51,7 @@ b: 4.5
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval '.a = .a - .b' sample.yml
|
||||
yq '.a = .a - .b' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
@@ -69,7 +69,7 @@ b: 4.5
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval '.a = .a - .b' sample.yml
|
||||
yq '.a = .a - .b' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
@@ -87,7 +87,7 @@ b: 4
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval '.a = .a - .b' sample.yml
|
||||
yq '.a = .a - .b' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
@@ -103,7 +103,7 @@ b: 5
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval '.[] -= 1' sample.yml
|
||||
yq '.[] -= 1' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
@@ -121,7 +121,7 @@ b: !goat 1
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq eval '.a -= .b' sample.yml
|
||||
yq '.a -= .b' sample.yml
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
|
||||
Reference in New Issue
Block a user