Part III · Shell and commands
27. Environment & shell
- 27.1Where environment variables come fromEvery process gets a copy of its parent's environment: a list of NAME=value strings.
- 27.2Shell startup filesA login shell (console, SSH) reads the profile files. bash reads only the first that exists of ~/.bash_profile, ~/.bash_login and ~/.profile.
- 27.3Redirections and file descriptorsEvery program starts with three open files: 0 is stdin (its input), 1 is stdout (its output), 2 is stderr (its errors).
- 27.4Exit codesEvery command ends with a number: 0 means success, anything else (1 to 255) a failure.