What are the caveats of having one single file with environment variables?
What I would like to do is to create a file (e.g.
~/.env) which contains all necessary
PATH declarations and possibly other non-confidential environment variables, such as
GOPATH, and have this file sourced from within each of shell-specific dotfiles.
Specifically, I would want to include the line
The goal is to have a consistent behaviour of commands executed in interactive/non-interactive and login/non-login shells.
Why would I not want to do this? Are there any problems that may occur because of this?
I have read a bunch of answers on SE related to the topic such as
and I understand what are some suggested practices of env declarations. However, I would like to know if the method above is also acceptable and safe.