GitBook: [#206] deep update example

This commit is contained in:
Mike Farah
2021-10-30 03:14:39 +00:00
committed by gitbook-bot
parent b723783231
commit fbe266a166
49 changed files with 7156 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
# Pipe
Pipe the results of an expression into another. Like the bash operator.
## Simple Pipe
Given a sample.yml file of:
```yaml
a:
b: cat
```
then
```bash
yq eval '.a | .b' sample.yml
```
will output
```yaml
cat
```
## Multiple updates
Given a sample.yml file of:
```yaml
a: cow
b: sheep
c: same
```
then
```bash
yq eval '.a = "cat" | .b = "dog"' sample.yml
```
will output
```yaml
a: cat
b: dog
c: same
```