Updating readme

This commit is contained in:
Mike Farah 2022-03-29 13:15:27 +11:00
parent 0956eefb1a
commit 5d225b9454
2 changed files with 7 additions and 7 deletions

View File

@ -18,12 +18,12 @@ TLDR:
Prior to 4.18.1
```bash
cat file.yaml | yq e '.cool' -
yq e '.cool' - < file.yaml
```
4.18+
```bash
cat file.yaml | yq '.cool'
yq '.cool' < file.yaml
```
When merging multiple files together, `eval-all/ea` is still required to tell `yq` to run the expression against all the document at once.
@ -37,7 +37,7 @@ yq '.a.b[0].c' file.yaml
Pipe from STDIN:
```bash
cat file.yaml | yq '.a.b[0].c'
yq '.a.b[0].c' < file.yaml
```
Update a yaml file, inplace
@ -143,11 +143,11 @@ podman run --rm -v "${PWD}":/workdir mikefarah/yq [command] [flags] [expression
You'll need to pass the `-i\--interactive` flag to docker:
```bash
cat myfile.yml | docker run -i --rm mikefarah/yq '.this.thing'
docker run -i --rm mikefarah/yq '.this.thing' < myfile.yml
```
```bash
cat myfile.yml | podman run -i --rm mikefarah/yq '.this.thing'
podman run -i --rm mikefarah/yq '.this.thing' < myfile.yml
```
#### Run commands interactively:
@ -310,7 +310,7 @@ Usage:
Examples:
# yq defaults to 'eval' command if no command is specified. See "yq eval --help" for more examples.
cat myfile.yml | yq '.stuff' # outputs the data at the "stuff" node from "myfile.yml"
yq '.stuff' < myfile.yml # outputs the data at the "stuff" node from "myfile.yml"
yq -i '.stuff = "foo"' myfile.yml # update myfile.yml inplace

View File

@ -18,7 +18,7 @@ See https://mikefarah.gitbook.io/yq/ for detailed documentation and examples.`,
# yq defaults to 'eval' command if no command is specified. See "yq eval --help" for more examples.
# read the "stuff" node from "myfile.yml"
cat myfile.yml | yq '.stuff'
yq '.stuff' < myfile.yml
# update myfile.yml in place
yq -i '.stuff = "foo"' myfile.yml