mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-13 22:38:04 +00:00
Updating readme
This commit is contained in:
parent
0956eefb1a
commit
5d225b9454
12
README.md
12
README.md
@ -18,12 +18,12 @@ TLDR:
|
|||||||
|
|
||||||
Prior to 4.18.1
|
Prior to 4.18.1
|
||||||
```bash
|
```bash
|
||||||
cat file.yaml | yq e '.cool' -
|
yq e '.cool' - < file.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
4.18+
|
4.18+
|
||||||
```bash
|
```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.
|
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:
|
Pipe from STDIN:
|
||||||
```bash
|
```bash
|
||||||
cat file.yaml | yq '.a.b[0].c'
|
yq '.a.b[0].c' < file.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Update a yaml file, inplace
|
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:
|
You'll need to pass the `-i\--interactive` flag to docker:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cat myfile.yml | docker run -i --rm mikefarah/yq '.this.thing'
|
docker run -i --rm mikefarah/yq '.this.thing' < myfile.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```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:
|
#### Run commands interactively:
|
||||||
@ -310,7 +310,7 @@ Usage:
|
|||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
# yq defaults to 'eval' command if no command is specified. See "yq eval --help" for more 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
|
yq -i '.stuff = "foo"' myfile.yml # update myfile.yml inplace
|
||||||
|
|
||||||
|
@ -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.
|
# yq defaults to 'eval' command if no command is specified. See "yq eval --help" for more examples.
|
||||||
|
|
||||||
# read the "stuff" node from "myfile.yml"
|
# read the "stuff" node from "myfile.yml"
|
||||||
cat myfile.yml | yq '.stuff'
|
yq '.stuff' < myfile.yml
|
||||||
|
|
||||||
# update myfile.yml in place
|
# update myfile.yml in place
|
||||||
yq -i '.stuff = "foo"' myfile.yml
|
yq -i '.stuff = "foo"' myfile.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user