1variables(1)                  Grass User's Manual                 variables(1)
2
3
4

GRASS variables and environment variables

6       There are two types of variables:
7
8                     environment variables,
9
10                     GRASS gisenv variables.
11       Any setting which needs to be modifiable by a GRASS program (e.g. MONI‐
12       TOR) has to be a GRASS variable.
13
15       GRASS maintains some settings in a number of files on the system.  They
16       are detailed below.
17

Setting environment variables

19       Setting environment variables depends on the shell being used:
20         Bash:     export VARIABLE=value
21          or
22         Csh:      setenv VARIABLE value
23

Setting environment variables permanently

25                     To  get  personal  BASH shell definitions (aliases, color
26                     listing option, ...)  into GRASS, store them in:
27                     $HOME/.grass.bashrc
28
29                     To get personal CSH  shell  definitions  (aliases,  color
30                     listing option, ...)  into GRASS, store them in:
31                     $HOME/.grass.cshrc
32

Setting GRASS variables

34       Use  "g.gisenv"  within  GRASS. This permanently predefines GRASS vari‐
35       ables in the .grassrc6 file.
36
37       Usage:
38
39       g.gisenv set="VARIABLE=VALUE"
40
41
42       It looks unusual with two equals signs, but g.gisenv serves  dual  duty
43       for getting and setting GRASS variables.
44
45       If  the user just specifies a variable name, it defaults to "get" mode.
46       For example:
47
48       GRASS ~> g.gisenv GRASS_GUI
49       text
50
51

List of selected (GRASS related) environment variables

53       [ To be set from the terminal shell or startup scripts ]
54
55       GISBASE
56         directory where GRASS lives. This is set automatically by the startup
57       script.
58
59       GISRC
60         name  of  .grassrc6 file. GISRCRC defines the system wide value while
61       in a GRASS session.
62
63       GRASS_ADDON_PATH
64       [grass startup script]
65         allows to specify additional paths to local GRASS  modules  extra  to
66       standard distribution
67
68       GRASS_ERROR_MAIL
69         set  to  any value to send user mail on an error or warning that hap‐
70       pens while stderr is being redirected.
71
72       GRASS_GNUPLOT
73       [i.spectral]
74         program to use for plotting "gnuplot" data
75
76       GRASS_HEIGHT
77       [d.mon]
78         defines the height of GRASS monitor, see also GRASS_WIDTH
79
80       GRASS_HTML_BROWSER
81       [init.sh, d.m]
82         defines name of HTML browser
83
84       GRASS_INT_ZLIB
85       [libgis]
86         If the environment variable  GRASS_INT_ZLIB  exists,  new  compressed
87       rasters  will be compressed using zlib instead of RLE compression. Such
88       rasters will have a "compressed" value of 2 in the cellhd file.
89       Obviously, decompression is controlled  by  the  raster's  "compressed"
90       value, not the environment variable.
91
92       GRASS_MESSAGE_FORMAT
93       [various modules]
94       Maybe set to either "standard" or "gui" (normally GRASS takes care)
95
96       GRASS_MOUSE_BUTTON
97       [various modules]
98         swaps mouse buttons for two-button or left-handed mice. Its value has
99       three digits 1, 2, and 3, which represent  default  left,  middle,  and
100       right buttons respectively. Setting to "132" will swap middle and right
101       buttons. Note that this variable should be set before a display  driver
102       is initialized (e.g., d.mon x0).
103
104       GRASS_PAGER
105       [various modules]
106       Maybe set to either "less" or "more"
107
108       GRASS_PERL
109         set perl with path
110
111       GRASS_TCLSH
112       [nviz]
113         set tclsh shell name to override 'tclsh'
114
115       GRASS_TERM
116       lib/init/grass-xterm-wrapper
117         set  to any value (e.g. rxvt, aterm, gnome-terminal, konsole) to sub‐
118       stitute 'x-terminal-emulator' or 'xterm'
119
120       GRASS_UI_TERM
121         set to any value to use the terminal based parser
122
123       GRASS_VERSION
124         reports the current version number (used by R-stats interface etc);
125         should not be changed by user
126
127       GRASS_WIDTH
128       [d.mon]
129         defines the width of GRASS monitor, see also GRASS_HEIGHT
130
131       GRASS_WISH
132       [d.m, nviz]
133         set wish shell name to override 'wish'
134
135       GRASS_GLX_PBUFFERS
136       [nviz]
137         set to any value to enable the use of OpenGL Pixel Buffers
138
139       GRASS_GLX_PIXMAPS
140       [nviz]
141         set to any value to enable the use of OpenGL Pixmaps
142
143   List of selected GRASS PNG driver environment variables
144       [ These variables control the function of the PNG Driver. ]
145
146       GRASS_PNGFILE
147         name of PNG output file
148
149       GRASS_WIDTH
150         defines the width of GRASS monitor, see also GRASS_HEIGHT
151
152       GRASS_HEIGHT
153         defines the height of GRASS monitor, see also GRASS_WIDTH
154
155       GRASS_BACKGROUNDCOLOR
156         defines the background color of the image created by the PNG driver
157
158       GRASS_TRANSPARENT
159         if "TRUE", the image created by the PNG driver will have a  transpar‐
160       ent background
161
162       GRASS_PNG_COMPRESSION
163         compression level of PNG files (0 = none, 1 = fastest, 9 = best)
164
165       GRASS_TRUECOLOR
166         if "TRUE", the PNG driver generates a true-color image
167
168       GRASS_PNG_AUTO_WRITE
169         tells  the  PNG driver to write the image to a file whenever a client
170       disconnects, rather than waiting until you stop the monitor
171
172       GRASS_RENDER_IMMEDIATE
173         tells the raster library to use its built-in PNG driver  rather  than
174       connecting  to an external monitor process using sockets. If GRASS_REN‐
175       DER_IMMEDIATE=TRUE is set, there is no need to run "d.mon start=PNG"
176
177   List of selected internal GRASS environment variables
178       [ These variables are intended for internal use only by the GRASS soft‐
179       ware  to facilitate communiction between the GIS engine, GRASS scripts,
180       and the GUI.  The user should not set these in a  GRASS  session.  They
181       are meant to be set locally for specific commands. ]
182
183       GRASS_OVERWRITE
184       [all modules]
185         toggles map overwrite.
186           With 0 maps are protected (default),
187           With 1 maps with identical names will be overwritten.
188       This variable is automatically created by g.parser so that "--o" option
189       will be inherited by dependant modules  as  the  script  runs.  Setting
190       either the GRASS_OVERWRITE environment variable or the OVERWRITE gisenv
191       variable detailed below will cause maps  with  identical  names  to  be
192       overwritten.
193
194       GRASS_REGION
195       [libgis]
196         Override  region  settings, separate parameters with a ";". Format is
197       the same as in the WIND region settings file. Otherwise use is the same
198       as WIND_OVERRIDE.
199
200       WIND_OVERRIDE
201       [libgis]
202
203       It causes programs to use the specified named region (created with e.g.
204       "g.region save=...") to be used as the current region, instead  of  the
205       region from the WIND file.
206       This  allows  programs  such  as  gis.m  to run external commands on an
207       alternate region without having to modify the WIND file then change  it
208       back afterwards.
209

List of selected GRASS gisenv variables

211       [ Use g.gisenv to get/set/unset/change them ]
212
213       DEBUG
214       [entire GRASS]
215         sets level of debug message output (0: no debug messages)
216       g.gisenv set=DEBUG=0
217
218       DM_FORM_MODE
219       [d.m]
220         sets default form mode (txt or gui)
221       g.gisenv set=DM_FORM_MODE=txt
222
223       GISDBASE
224         initial database
225
226       GIS_LOCK
227         lock ID to prevent parallel GRASS use,
228         process id of the start-up shell script
229
230       GRASS_DB_ENCODING
231       [d.what.vect/forms library]
232         encoding of query form (utf-8, ascii, iso8859-1, koi8-r)
233
234       GRASS_GUI
235         either "text" or "tcltk" to define non-/graphical startup
236
237       LOCATION
238        full path to location directory
239
240       LOCATION_NAME
241        initial location name
242
243       MAPSET
244         initial mapset
245
246       OVERWRITE
247       [all modules]
248         toggles map overwrite.
249           With 0 maps are protected (default),
250           With 1 maps with identical names will be overwritten.
251         Example: g.gisenv set="OVERWRITE=0"
252         You  can force an overwrite for an individual command by adding "--o"
253       to the command:
254         r.in.gdal --o output=existing_map ...
255
257       $HOME/.grassrc6
258         stores the GRASS variables (but not environment variables)
259
260       $HOME/GIS_ERROR_LOG
261         If this file exists then all GRASS error  and  warning  messages  are
262       logged here. Applies to current user. To generate the file, use:
263          touch $HOME/GIS_ERROR_LOG
264
265       $GISBASE/GIS_ERROR_LOG
266         If  this  file  exists  then all GRASS error and warning messages are
267       logged here. Applies to all users. (proper write permissions must be in
268       place)
269
270       Note:  Error and warning messages encountered while using the GUI menus
271       are not logged.
272
273   SEE ALSO
274       g.gisenv
275
276       Last changed: $Date: 2006/09/20 06:09:43 $
277
278       Help Index
279
280
281
282GRASS 6.2.2                                                       variables(1)
Impressum