Load variables from .env file into current environment
Load an .env file into the environment prior to running something which requires the environment variables:
You can now use the variables from the .env
file in scripts:
Load .env file from .bashrc
, .zshrc
, etc.
If you keep your configuration, like I do, in a public dotfiles repository, you might want to keep your
.env
file secret, and make sure it is added to your .gitignore
file. Then you can have it loaded
from your .bashrc
or .zshrc
file:
.bashrc