mirror of
https://github.com/mikefarah/yq.git
synced 2025-02-14 11:52:11 +00:00
Fixed load from another file tip
This commit is contained in:
parent
ab1855e30d
commit
05ee6a44cf
@ -44,13 +44,7 @@ edit
|
||||
|
||||
## Set contents from another file
|
||||
|
||||
Use an environment variable with the `strenv` operator to inject the contents from an environment variable.
|
||||
|
||||
```bash
|
||||
LICENSE=$(cat LICENSE) yq -n '.a = strenv(LICENSE)'
|
||||
```
|
||||
|
||||
Note that `bash` substitution "$(..)" trims newlines, this will cause string blocks to start with `|-` instead of `|`. If you want to keep your nice trailing newline, read more [here](https://mikefarah.gitbook.io/yq/operators/string-operators#string-blocks-bash-and-newlines)
|
||||
Use the [load](https://mikefarah.gitbook.io/yq/operators/load) operator to load contents from another file.
|
||||
|
||||
|
||||
## Special characters in strings
|
||||
|
Loading…
Reference in New Issue
Block a user