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 GitHub
parent ff598e1933
commit f67c0038f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 "$@"
}
```