docs(readme): protect parameter expansions

Avoid unwanted word-splitting, including in the working directory path.
This commit is contained in:
M. Minot 2020-04-17 14:46:20 +02:00 committed by Mike Farah
parent 3f913afbb9
commit 3ccd32a47e

View File

@ -60,20 +60,20 @@ GO111MODULE=on go get github.com/mikefarah/yq/v3
Oneshot use:
```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:
```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:
```bash
yq() {
docker run --rm -i -v ${PWD}:/workdir mikefarah/yq yq $@
docker run --rm -i -v "${PWD}":/workdir mikefarah/yq yq "$@"
}
```