# GRASS 5 Environment Variables

Disclaimer: there is no real need to be concerned with most of these variables. The default settings will work fine for most users. They are mainly used to preserve settings so that the next time the user runs GRASS, it knows a little bit about how you left things.

The following is a list of environment variables used in GRASS. These variables were found by searching all *.c *.h files for the words "setenv" and "getenv" individually. Note that some of them are not yet found in the source code. These are indicated along with the date they were last checked (dd/mm/yy).

The second part lists GRASS related files.

## Setting environment variables

Setting environment variables depends on the shell being used:

`export VARIABLE=value`

or

`setenv VARIABLE value`

An alternate option is to use "g.gisenv" (within GRASS):

Use: `g.gisenv set=VARIABLE=VALUE`

It looks unusual with two equals signs, but g.gisenv does dual duty for getting and setting GRASS environment variables. If the user just specifies a variable name, it defaults to "get" mode. Example:

`GRASS ~> g.gisenv GRASS_GUI
text`

To permanently predefine GRASS environment variables the user may specify the variable(s) in the .grassrc5 file.

## List of GRASS environment variables

ANGLE

ANOTHER_BUTTON
[v.digit]
define to click conveniently for two button mouse.
It's hard to click two buttons simultaneously with two button mouse,
#ifndef ANOTHER_BUTTON
# define MIDDLEB 2
# define RIGHTB 3
#else
# define MIDDLEB 3
# define RIGHTB 2
#endif

GRASS_BACKGROUNDCOLOR
[PNGdriver]
defines the background color of the image created by the PNG driver

BAUD

CMAP_SIZE

CODECENTER

DARKEN

DATABASE

DBMSCAP
[db.connect]
defines DBMI driver

DBPATH

DB_DATABASE

DB_DRIVER

DB_KEYCOL

DB_LOCATION

DB_PASSWORD

DB_USER

DEB

DEBUG

DIGITIZER
[v.digit]
name of currently selected digitizer board

DPG_LOCK

DUMP

ELEMENT_LIST
pathname of element list file to use instead of $GISBASE/etc/element_list

ENDPANEL

FORCE_GRASS3_COLORS
define to force color table output format in 3.0, even if the structure
contains 4.0 rules

GRASS_FP_DOUBLE
define GRASS floating point type (DCELL_TYPE, FCELL_TYPE)

G3D_CACHE_SIZE_ENV_VAR

G3D_CACHE_SIZE_MAX_ENV_VAR

G3D_COMPRESSION_ENV_VAR_NO

G3D_COMPRESSION_ENV_VAR_YES

G3D_DEFAULT_WINDOW3D

G3D_FATAL_ERROR_ENV_VAR

G3D_FILE_DOUBLE_ENV_VAR

G3D_FILE_FLOAT_ENV_VAR

G3D_PRECISION_ENV_VAR

G3D_PRECISION_ENV_VAR_MAX

G3D_PRINT_ERROR_ENV_VAR

G3D_RLE_ENV_VAR_NO

G3D_RLE_ENV_VAR_YES

G3D_TILE_DIM_X_ENV_VAR

G3D_TILE_DIM_Y_ENV_VAR

G3D_TILE_DIM_Z_ENV_VAR

GDAL_HOME

GISBASE
directory where GRASS lives

GISDBASE
initial database

GISRC
name of .grassrc5 file

GIS_LOCK
lock ID to prevent parallel GRAS use,
process id of the start-up shell script

GMPEG_SIZE

GRAPH

HEIGHT

GRASS_ADDON_PATH
[grass5] startup script
allows to specify additional paths to local GRASS modules extra to standard distribution

GRASS_GNUPLOT
[m.svfit, s.probplt, s.sv]
program to use for plotting "gnuplot" data

GRASS_GUI
either "text" or "tcltk" to define non-/graphical startup

GRASS_HEIGHT
[d.mon]
defines the height of GRASS monitor

GRASS_WIDTH
[d.mon]
defines the width of GRASS monitor

GTUNE_VSUP_RAM

GTUNE_VTOC_RAM

HOME
user's home directory

GRASS_HTMLFILE

GRASS_HTMLMAXPOINTS

GRASS_HTMLMINBBOX

GRASS_HTMLMINDIST

GRASS_HTMLTYPE

LOCATION
full path to location directory

LOCATION_NAME
initial location name

MAPLP
[ppm driver]

MAPSET
initial mapset

MONITOR
[d.mon]
name of selected GRASS monitor

NODUMP

NO_DRAW

NPIXELS

Nviz_AutoSurfColors
[nviz]

ORACLE_HOME

GRASS_PAGER
[various modules]
Maybe set to either "less" or "more"

PAINT

PAINTER
currently selected paint output device

PAINT_DRIVER

PAINT_DRIVER_SHELL

PAINT_HEADER

PAINT_TRACE

GRASS_ORGANIZATION
[various vector modules which generate new vector maps]
To set the owner of the vector map ("Organization"). Default is "GRASS Development Team"

GRASS_PAN_THRESHOLD
[v.digit]
auto-pan moving speed. Auto panning can be set off by setting
GRASS_PAN_THRESHOLD=0

GRASS_PERL
set perl with path

PGSQL - not found in source 20/02/01

PG_HOST
[g.select.pg]
name of PostgreSQL host

PG_DBASE
[g.select.pg]
name of selected PostgreSQL database

GRASS_PNGFILE
[PNGdriver]
name of PNG output file

PREVIEW_BACKGROUND

PROJ_LIB

PSPAINTER
[ps.select]
naem of ps device to print to

PWAIT

QUALITY

RASTERFILE

SG3D_HEIGHT
[sg3d]

SG3D_SITE_CACHE
[sg3d]

SG3D_WIDTH
[sg3d]

SHORT

GRASS_SLEEP - not found in source 20/02/01

SPAG_THRESH
[v.spag]
snap threshold value

SPRINT_COMMAND

SQLBASE_DIR

SQLBASE_DRIVER_STDERR

SQLBASE_SERVER

STARTPANEL

GRASS_STDERR
set to prevent user mail on error

GRASS_TCLSH
[tcltkgrass, nviz]
set tclsh shell name to override 'tclsh'

TERM
current terminal type

GRASS_TEXT_BROWSER - not found in source 20/02/01

GRASS_TRANSPARENT
[PNGdriver]
if "TRUE", the image created by the PNG driver will have a transparent background

GRASS_TRUECOLOR
[PNGdriver]
if "TRUE", the PNG driver generates a true-color image (requires GD 2.0)

USER

WIDTH

GRASS_WISH
[tcltkgrass, nviz]
set wish shell name to override 'wish'

WRITE

X3D_HEIGHT

X3D_WIDTH

XDRIVER_PRIVATE_CMAP
[d.mon]
if set, use a private colormap

XDRIVER_WINDOW
[d.mon]
if set, should contain an X window ID; XDRIVER will use this window instead of creating its own

XGANIM_SIZE

_XPG

GRASS-related Files:

$HOME/.grassrc5

$HOME/.tcltkgrass

$HOME/GIS_ERROR_LOG
If this file exists, all GRASS error messages are stored here instead of sending a mail to the GIS user. To generate the file, use:
touch $HOME/GIS_ERROR_LOG

### Other Commands

help home, database, display, drivers, general, grid3d, imagery, import, misc, models, paint, photo, postscript, raster, scripts, sites, vector

GRASS Development Team
$Date: 2002/11/04 08:19:09 $