envdir — runs another program with environment modified according to files in a specified directory.
| Use Case | Command | Description |
|---|---|---|
| Run program with environment from a directory | envdir /path/to/envdir program args | Sets environment variables from files in /path/to/envdir, then runs program. |
| Set a variable from a file | echo "VALUE" > /path/to/envdir/VARenvdir /path/to/envdir program | Creates file VAR with first line as value; envdir sets VAR to that value. |
| Unset a variable | touch /path/to/envdir/VARenvdir /path/to/envdir program | Empty file (0 bytes) causes envdir to remove VAR from the environment. |
| Run a child process | envdir d child | d is the directory, child is the program to run with the modified environment. |
envdir d child
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.
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. The name s must not contain =. Spaces and tabs at the end of t are removed. Nulls in t are changed to newlines in the environment variable.
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.
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.
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-07 21:16 @216.73.217.130
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)