mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-27 00:47:56 +00:00
docs(readme): protect parameter expansions
Avoid unwanted word-splitting, including in the working directory path.
This commit is contained in:
parent
3f913afbb9
commit
3ccd32a47e
@ -60,20 +60,20 @@ GO111MODULE=on go get github.com/mikefarah/yq/v3
|
|||||||
Oneshot use:
|
Oneshot use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --rm -v ${PWD}:/workdir mikefarah/yq yq [flags] <command> FILE...
|
docker run --rm -v "${PWD}":/workdir mikefarah/yq yq [flags] <command> FILE...
|
||||||
```
|
```
|
||||||
|
|
||||||
Run commands interactively:
|
Run commands interactively:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --rm -it -v ${PWD}:/workdir mikefarah/yq sh
|
docker run --rm -it -v "${PWD}":/workdir mikefarah/yq sh
|
||||||
```
|
```
|
||||||
|
|
||||||
It can be useful to have a bash function to avoid typing the whole docker command:
|
It can be useful to have a bash function to avoid typing the whole docker command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yq() {
|
yq() {
|
||||||
docker run --rm -i -v ${PWD}:/workdir mikefarah/yq yq $@
|
docker run --rm -i -v "${PWD}":/workdir mikefarah/yq yq "$@"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user