Posts

Showing posts from March, 2021

Linux Environment Management: direnv does it all

  Linux Environment Management: direnv does it all A few years back I wrote about different options for linux environment management .  I recently learned about another option, direnv.  I think I'm convinced that it is the only tool you need.  Read this as if it's another section added to that previous post. Use direnv Straight from  the direnv website : "direnv is an extension for your shell. It augments existing shells with a new feature that can load and unload environment variables depending on the current directory.  Before each prompt, direnv checks for the existence of a .envrc file in the current and parent directories. If the file exists (and is authorized), it is loaded" This happens automatically, so it solves the problem of the "Explicit Environment Files" solution above in a way that is much more convenient than the "Per-command Environment Files" solution. The .envrc files are in standard shell syntax and it properly unloads environme