variables (1) Linux Manual Page
GRASS variables and environment variables
There are two types of variables:
-
- shell environment variables,
- GRASS gisenv variables.
There are a number of shell environment variable groups:
-
- PNG driver
- PS driver (PostScript)
- variables for direct rendering
- variables for internal use
Any setting which needs to be modifiable by a GRASS program (e.g. MONITOR) has to be a GRASS gisenv variable.
GRASS-related Files
GRASS maintains some settings in a number of files on the system. They are detailed below.
Setting environment variables
Setting environment variables depends on the shell being used:
or
or
Setting environment variables permanently
-
- To get personal BASH shell definitions (aliases, color listing option, …) into GRASS, store them in:
$HOME/.grass.bashrc - To get personal CSH shell definitions (aliases, color listing option, …) into GRASS, store them in:
$HOME/.grass.cshrc
Setting GRASS variables
Use "g.gisenv" within GRASS. This permanently predefines GRASS variables in the .grassrc6 file.
Usage:
g.gisenv set="VARIABLE=VALUE"
It looks unusual with two equals signs, but g.gisenv serves dual duty for getting and setting GRASS variables.
If the user just specifies a variable name, it defaults to "get" mode. For example:
GRASS ~> g.gisenv GRASS_GUI
text
List of selected (GRASS related) environment variables
[ To be set from the terminal shell or startup scripts ]
GISBASE
GISRC
GRASS_ADDON_PATH
[grass startup script]
GRASS_ADDON_ETC
[libgis, g.findetc]
GRASS_BATCH_JOB
GRASS_ERROR_MAIL
GRASS_GNUPLOT
[i.spectral]
GRASS_GUI
GRASS_FONT_CAP
[g.mkfontcap, d.font, display drivers]
GRASS_HEIGHT
[d.mon]
GRASS_HTML_BROWSER
[init.sh, d.m, gis.m]
Mac OS X runs applications differently from the CLI. Therefore, GRASS_HTML_BROWSER should be the application’s signature, which is a domain-like name, just reversed. ie: com.apple.Safari. To find an application’s signature, type the following in a Terminal (fill in the path to the application you are interested in, for example: /Applications/Safari.app):
grep -A 1 "CFBundleIdentifier" /path/to/application.app/Contents/Info.plist
The signature is the following the , without the bracketing tags.
GRASS_INT_ZLIB
[libgis]
Obviously, decompression is controlled by the raster’s "compressed" value, not the environment variable.
GRASS_MESSAGE_FORMAT
[various modules]
Maybe set to either "standard" or "gui" (normally GRASS takes care)
GRASS_MOUSE_BUTTON
[various modules]
GRASS_PAGER
[various modules]
Maybe set to either "less" or "more"
GRASS_PERL
[Used during install process for generating man pages]
GRASS_RND_SEED
GRASS_SH
[shell scripts on Windows]
Path to bourne shell interpreter used to run shell scripts
GRASS_TCLSH
[nviz]
GRASS_XTERM
lib/init/grass-xterm-wrapper
lib/init/grass-xterm-mac
GRASS_UI_TERM
GRASS_VERSION
GRASS_WIDTH
[d.mon]
GRASS_WISH
[d.m, nviz]
GRASS_NO_GLX_PBUFFERS
[nviz]
GRASS_NO_GLX_PIXMAPS
[nviz]
List of selected GRASS PNG driver environment variables
[ These variables control the function of the PNG Driver. ]
GRASS_PNGFILE
GRASS_WIDTH
GRASS_HEIGHT
GRASS_BACKGROUNDCOLOR
GRASS_TRANSPARENT
GRASS_PNG_COMPRESSION
GRASS_TRUECOLOR
GRASS_PNG_AUTO_WRITE
GRASS_PNG_READ
GRASS_PNG_MAPPED
List of selected GRASS PS driver environment variables
[ These variables control the function of the PS Driver. ]
GRASS_PSFILE
GRASS_PAPER
GRASS_WIDTH
GRASS_HEIGHT
GRASS_TRUECOLOR
GRASS_LANDSCAPE
GRASS_PS_HEADER
GRASS_PS_TRAILER
List of selected GRASS environment variables for direct rendering
[ In addition to those which are understood by the PNG Driver, the following variables affect direct rendering. ]
GRASS_RENDER_IMMEDIATE
GRASS_FONT
GRASS_ENCODING
List of selected internal GRASS environment variables
[ These variables are intended for internal use only by the GRASS software to facilitate communiction between the GIS engine, GRASS scripts, and the GUI. The user should not set these in a GRASS session. They are meant to be set locally for specific commands. ]
GRASS_OVERWRITE
[all modules]
-
-
0 – maps are protected (default), 1 – maps with identical names will be overwritten.
This variable is automatically created by g.parser so that the dq–overwrite" option will be inherited by dependant modules as the script runs. Setting either the GRASS_OVERWRITE environment variable or the OVERWRITE gisenv variable detailed below will cause maps with identical names to be overwritten.
GRASS_VERBOSE
[all modules]
-
-
0 – only errors and warnings are printed 1 – progress messages are printed (percent complete) 2 – all module messages are printed 3 – additional verbose messages are printed
This variable is automatically created by g.parser so that the "–verbose" or "–quiet" flags will be inherited by dependant modules as the script runs.
GRASS_REGION
[libgis]
WIND_OVERRIDE
[libgis]
This allows programs such as gis.m to run external commands on an alternate region without having to modify the WIND file then change it back afterwards.
List of selected GRASS gisenv variables
[ Use g.gisenv to get/set/unset/change them ]
DEBUG
[entire GRASS]
g.gisenv set=DEBUG=0
DM_FORM_MODE
[d.m]
g.gisenv set=DM_FORM_MODE=txt
GISDBASE
GIS_LOCK
GRASS_DB_ENCODING
[d.what.vect/forms library]
GRASS_GUI
LOCATION
LOCATION_NAME
MAPSET
OVERWRITE
[all modules]
GRASS-related Files
$HOME/.grassrc6
$HOME/.grasslogin6
stores the DBMI passwords in this hidden file Only the file owner can access this file.
$HOME/GIS_ERROR_LOG
touch
$GISBASE/GIS_ERROR_LOG
Note: Error and warning messages encountered while using the GUI menus are not logged.
SEE ALSO
g.gisenv, g.parser
Last changed: $Date: 2008-04-15 19:10:05 +0200 (Tue, 15 Apr 2008) $
Help Index
