envdir(8)
π envdir(8) β bestie edition π
okay so this is envdir, from the System Manager's Manual, and it's literally one of those tiny tools that does one thing and does it flawlessly β¨
β¨ NAME β¨
envdir β runs another program with environment modified according to files in a specified directory.
like. it runs your program. but the environment? customized. by files. in a directory. we love a filesystem-as-config moment π
πΈ SYNOPSIS πΈ
envdir d child
π DESCRIPTION π
okay bestie, sit down, this is so simple you're gonna scream π«Ά
d is a single argument. child consists of one or more arguments.
envdir sets various environment variables as specified by files in the directory named d. It then runs child. that's it. that's the whole vibe. directory of files β environment variables β your program π¦
here's the tea on how it actually works:
If d contains a file named s whose first line is t, envdir removes an environment variable named s if one exists, and then adds an environment variable named s with value t. so it's not "merge" β it's yeet the old one, drop in the new one π
and bestie, the namesmust not contain=. that's the rule. don't fight it.
Spaces and tabs at the end of t are removed. Nulls in t are changed to newlines in the environment variable. (yes, that's a whole little transformation pipeline, it's giving glow-up for your bytes β¨)
and then the special case, because there's always a special case:
If the file s is completely empty (0 bytes long), envdir removes an environment variable named s if one exists, without adding a new variable. so an empty file is an unset, not an empty string. no cap. π
π EXIT CODES π
envdir exits 111 if it has trouble reading d, if it runs out of memory for environment variables, or if it cannot run child.
Otherwise its exit code is the same as that of child.
so like, 111 = envdir itself is having a moment π and literally anything else = that's just your program's business, envdir is only the messenger π
π SEE ALSO π
the whole friend group, they all hang out together:
supervise(8)svc(8)svok(8)svstat(8)svscanboot(8)svscan(8)readproctitle(8)fghack(8)pgrphack(8)multilog(8)tai64n(8)tai64nlocal(8)setuidgid(8)envuidgid(8)softlimit(8)setlock(8)
and the mothership itself: http://cr.yp.to/daemontools.html π
okay that's the whole page bestie π this was envdir(8) from the System Manager's Manual, brought to you by the daemontools crew (yes, that cr.yp.to link up there is the source of the whole saga, go say hi π). go set some environment variables. slay. periodt. β¨ππ¦
π¦ where this page comes from
- debian bookworm: daemontools 1:0.76-8.1 Β· LicenseRef-public-domain
- debian trixie: daemontools 1:0.76-14 Β· LicenseRef-public-domain
- nixpkgs unstable: daemontools 0.76
- ubuntu jammy: daemontools 1:0.76-7
- ubuntu noble: daemontools 1:0.76-10 Β· LicenseRef-public-domain
- ubuntu questing: daemontools 1:0.76-15
- ubuntu resolute: daemontools 1:0.76-15build1 Β· LicenseRef-public-domain
- ubuntu stonking: daemontools 1:0.76-15build1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms