| 1 |
# OS Functions |
| 2 |
|
| 3 |
_WARNING:_ These functions can lead to information leakage if not used |
| 4 |
appropriately. |
| 5 |
|
| 6 |
_WARNING:_ Some notable implementations of Sprig (such as |
| 7 |
[Kubernetes Helm](http://helm.sh) _do not provide these functions for security |
| 8 |
reasons_. |
| 9 |
|
| 10 |
## env |
| 11 |
|
| 12 |
The `env` function reads an environment variable: |
| 13 |
|
| 14 |
``` |
| 15 |
env "HOME" |
| 16 |
``` |
| 17 |
|
| 18 |
## expandenv |
| 19 |
|
| 20 |
To substitute environment variables in a string, use `expandenv`: |
| 21 |
|
| 22 |
``` |
| 23 |
expandenv "Your path is set to $PATH" |
| 24 |
``` |