In the section on the environment we discussed the concept of environment variables. We also mentioned that there are usually a large number of environment variables that are created centrally in /etc/profile. There are a number of these that have a predefined meaning in the Bourne Shell. They are not set automatically, mind, but they have meaning when they are set.

On most systems there are far more predefined variables than we list here. And some of these will mean something to your shell (most shells have more options than the Bourne Shell). Check your shell's documentation for a listing. The ones below are meaningful to the Bourne Shell and are usually also recognized by other shells.

Bourne Shell environment variables
VariableMeanings
HOMEThe user's home directory. Set automatically at login from the user's login directory in the password file
PATHThe default search path for executables.
CDPATHThe search path used with the cd builtin, to allow for shortcuts.
LANGThe directory for internationalization files, used by localizable programs.
MAILThe name of a mail file, that will be checked for the arrival of new mail.
MAILCHECKThe frequency in seconds that the shell checks for the arrival of mail.
MAILPATHA colon “:” separated list of file names, for the shell to check for incoming mail.
PS1The control string for your prompt, which defaults to “$ ”, unless you are the superuser, in which case it defaults to “# ”.
PS2The control string for your secondary prompt, which defaults to “> ”. The secondary prompt is what you see when you break a command over more than one line.
PS4The character string you see before the output of an execution trace (set -x); defaults to “+ ”.
IFSInput Field Separators. Basically the characters the shell considers to be whitespace. Normally set to 〈space〉, 〈tab〉, and 〈newline〉.
TERMThe terminal type, for use by the shell.
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.