Environment Variable
A named value in a process's environment, inherited by its children — the standard configuration channel.
An environment variable is a name-value pair held in a process's environment and inherited by every process it spawns. It is the lowest-common-denominator configuration mechanism: available in every language, on every platform, and requiring no file format.
Its defining property is inheritance, which is also the source of most of its confusions. A variable set in one shell is invisible to another. A variable set at the session-manager level is inherited by everything, including things launched years later, which is how a stale credential set once can override a properly configured one indefinitely with no file anywhere to explain it. When a tool reports using the wrong identity, the first question is which source it actually read: an environment variable almost always takes precedence over a stored credential.
Two further points. The absence of a required variable should be fatal, not defaulted; see Fail Fast and Defensive Default. And making a variable required has a wide blast radius — every entry point that lacks it will now fail, including the ones nobody thinks about: the test configuration, the container image, the provisioning script, and the code-generation step in continuous integration.
Directory-scoped environment loaders make per-project variables ergonomic, which is how one machine can hold several isolated configurations for the same tool.
See also6
Hand-picked in the note itself — the neighbours worth reading next.
Shell
The interactive command interpreter, and a programming language with unusually sharp edges.
Systems & Tooling15 connections
Secret Management
Storing, distributing, and rotating credentials without embedding them in code or history.
Systems & Tooling15 connections
Dotfiles
A tracked repository of personal configuration, making a machine setup reproducible.
Systems & Tooling6 connections
Containerization
Packaging an application with its dependencies into an isolated, reproducible runtime unit.
Systems & Tooling10 connections
Least Privilege
Granting only the permissions actually required, so a compromise has a small ceiling.
Systems & Tooling9 connections
XDG Base Directory Specification
A convention placing configuration, data, cache, and state in defined directories rather than the home directory.
Systems & Tooling5 connections
Related2
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from13
Notes elsewhere in the wiki that reach for this one.
- ContainerizationSystems & Tooling
Packaging an application with its dependencies into an isolated, reproducible runtime unit.
- CronSystems & Tooling
Time-based scheduling of recurring jobs, and the reasons scheduled jobs quietly stop working.
- Defensive DefaultMethod
A substituted value that papers over a missing input and hides the misconfiguration that produced it.
- DotfilesSystems & Tooling
A tracked repository of personal configuration, making a machine setup reproducible.
- Fail FastMethod
Crash at the point of misconfiguration rather than degrading quietly into a wrong state.
- Git WorktreeVersion Control & Delivery
An additional working directory attached to one repository, each on its own branch.
- Least PrivilegeSystems & Tooling
Granting only the permissions actually required, so a compromise has a small ceiling.
- PortSystems & Tooling
The numeric endpoint a network service listens on, and a scarce shared resource on a developer machine.
- Secret ManagementSystems & Tooling
Storing, distributing, and rotating credentials without embedding them in code or history.
- ShellSystems & Tooling
The interactive command interpreter, and a programming language with unusually sharp edges.
- Symbolic LinkSystems & Tooling
A file that points at another path, resolved transparently by most operations.
- Terminal User InterfaceGraphics & Games
An interface rendered as text in a terminal, and the design conventions that make command-line tools humane.
- XDG Base Directory SpecificationSystems & Tooling
A convention placing configuration, data, cache, and state in defined directories rather than the home directory.