Environment Vars (Units: A Unit Conversion Program and Scientific Calculator)

## 17 Environment Variables ¶

The `units` program uses the following environment variables:

`HOME` ¶

  Specifies the location of your home directory; it is used by `units` to find a personal units data file ‘`.units`’. On systems running Microsoft Windows, the file is ‘`unitdef.units`’, and if `HOME` does not exist, `units` tries to determine your home directory from the `HOMEDRIVE` and `HOMEPATH` environment variables; if these variables do not exist, units finally tries `USERPROFILE`—typically `C:\Users\username` (Windows Vista and Windows 7) or `C:\Documents and Settings\username` (Windows XP).

`LC_CTYPE, LANG` ¶

  Checked to determine the locale if `units` cannot obtain it from the operating system. Sections of the default main units data file are specific to certain locales.

`MYUNITSFILE` ¶

  Specifies your personal units data file. If this variable exists, `units` uses its value rather than searching your home directory for ‘`.units`’. The personal units file will not be loaded if any data files are given using the `-f` option.

`PAGER` ¶

  Specifies the pager to use for help and for displaying the conformable units. The help function browses the units database and calls the pager using the ‘`+n`’n syntax for specifying a line number. The default pager is `more`; `PAGER` can be used to specify alternatives such as `less`, `pg`, `emacs`, or `vi`.

`UNITS_ENGLISH` ¶

  Set to either ‘`US`’ or ‘`GB`’ to choose United States or British volume definitions, overriding the default from your locale.

`UNITSFILE` ¶

  Specifies the units data file to use (instead of the default). You can only specify a single units data file using this environment variable. If units data files are given using the `-f` option, the file specified by `UNITSFILE` will be not be loaded unless the `-f` option is given with the empty string (‘`units -f ""`’).

`UNITSLOCALEMAP` ¶

  Windows only; this variable has no effect on Unix-like systems. Specifies the units locale map file to use (instead of the default). This variable seldom needs to be set, but you can use it to ensure that the locale map file will be found if you specify a location for the units data file using either the `-f` option or the `UNITSFILE` environment variable, and that location does not also contain the locale map file.

`UNITS_SYSTEM` ¶

  This environment variable is used in the default main data file to select CGS measurement systems. Currently supported systems are ‘`esu`’, ‘`emu`’, ‘`gauss[ian]`’, ‘`hlu`’, ‘`natural`’, ‘`natural-gauss`’, ‘`planck`’, ‘`planck-red`’, ‘`hartree`’ and ‘`si`’. The default is ‘`si`’.