[GRASS5] Environment variable listings...

Glynn Clements glynn.clements at virgin.net
Sat Aug 11 06:51:08 EDT 2001


Analysing the results of a recursive grep indicate that:

1. The following variables are accessed using G__getenv() (including
use of G_getenv()):

DATABASE
DB_DATABASE
DB_DRIVER
DB_KEYCOL
DB_LOCATION
DB_PASSWORD
DB_USER
DIGITIZER
GISBASE
GISDBASE
LOCATION_NAME
MAPSET
MONITOR
Nviz_AutoSurfColors
PAINT
PAINTER
PAINT_DRIVER
PAINT_DRIVER_SHELL
PG_DBASE
PG_HOST
PSPAINTER

2. The following variables are accessed using getenv():

ANGLE
BAUD
CMAP_SIZE
CODECENTER
DBMSCAP
DEB
DEBUG
DISPLAY
DPG_LOCK
DUMP
ELEMENT_LIST
ENDPANEL
FORCE_GRASS3_COLORS
GDAL_HOME
GISBASE
GISRC
GIS_LOCK
GMPEG_SIZE
GRAPH
GRASS_BACKGROUNDCOLOR
GRASS_FP_DOUBLE
GRASS_GNUPLOT
GRASS_HEIGHT
GRASS_HTMLFILE
GRASS_HTMLMAXPOINTS
GRASS_HTMLMINBBOX
GRASS_HTMLMINDIST
GRASS_HTMLTYPE
GRASS_ORGANIZATION
GRASS_PAN_THRESHOLD
GRASS_PNGFILE
GRASS_STDERR
GRASS_TRANSPARENT
GRASS_WIDTH
GTUNE_VSUP_RAM
HEIGHT
HOME
LOCATION
LOCATION_NAME
MAPLP
NODUMP
NO_DRAW
NPIXELS
PAINT_HEADER
PAINT_TRACE
PREVIEW_BACKGROUND
PROJ_LIB
QUALITY
RASTERFILE
SHORT
SPAG_THRESH
SPRINT_COMMAND
SQLBASE_DRIVER_STDERR
STARTPANEL
TERM
TRANSPARENT
USER
WIDTH
XDRIVER_PRIVATE_CMAP
XGANIM_SIZE

3. The following variables are accessed using both methods:

GISBASE
LOCATION_NAME

Summary: 21 using G__getenv() and 60 using getenv(), with 2 variables
occurring in both categories.

> I guess what we need here is a little consistency.  Either ~/.grassrc5
> contains all the settable environment variables that are GRASS specific,
> or it shouldn't contain any.  Right now, there's apparently a mixture.

Due to the way in which the environment works, variables which are
changed by specific commands, (e.g. MONITOR and "d.mon select=...") 
cannot be implemented as environment variables.

OTOH, some of the above variables have to be environment variables. 
E.g. the value of TERM has to be taken from the environment, and HOME
and USER should probably be treated likewise.

In other cases, it's largely irrelevant, but only because GRASS is
currently tied to the "session" model, and doesn't permit a user to
run multiple GRASS sessions simultaneously. If this were to change, in
most cases there would be an advantage to using environment variables,
as they can be set on a per-process basis.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list