ENV(3) Library Functions Manual ENV(3)

env - environment device

bind #e /env
/env/name

The environment device serves a one-level directory giving access to environment variables and their values. It is conventionally bound to /env. The value of an environment variable name may be obtained by reading the file /env/name. If the file does not exist, the variable is unset and has the value nil. The maximum length of a variable name is 127 bytes.

New environment variables are set by creating the corresponding file in /env and writing the required value to that file. Similarly environment variables are destroyed (unset) by removing the corresponding file.

Processes sharing an `environment group' see the same files and contents; changes made by one process are seen by the others. A process can insulate itself from further changes using the option to sys-pctl (2), which creates a new environment group that is a copy of the old, but further changes in each are independent. A new empty environment group is created by the option to sys-pctl (2).

/os/port/devenv.c
/emu/port/devenv.c

env (1), sh (1), env (2), sys-pctl (2)