Environment variables

My standard .profile.d scripts set certain shell and environment variables which are referred to later. I try not to export variables which don't need to be seen by user processes.

PROFILE_HOME

If you run the become command to open a shell as another user this variable is set to the home directory of the user who ran become. In other words it is set to your home directory, as opposed to the home of the target user. When you run a regular shell as yourself it is unset.

SYSTEM

Set to the output of uname -s, eg Linux.

KERNEL

Set to the output of uname -r, eg 2.6.31.

ARCHITECTURE

Set to the output of uname -m, eg x86_64.

TERMINFO

Set to $PROFILE_HOME/.terminfo or ~/.terminfo if PROFILE_HOME is unset. I put terminfo entries for terminals which aren't always available from the OS distribution in here.

RESIZABLE

Set depending on the value of TERM. If it is known (in other words if I have seen it with my own eyes) that the terminal responds to standard xterm escape sequences to dynamically set the number of rows and columns, this variable is set to the value of TERM. For example xterm-256color.

If it is known that the terminal cannot be resized this is set to 0. For example linux.

It is my opinion that the user should not set TERM explicitly. It should be set by something else before your shell even starts.

RESIZABLE is used by my .vimrc to determine if the window can be resized, for example when toggling number mode.

PATH and friends

Have their own section.