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                     shell environment variables,
9
10                     GRASS gisenv variables.
11       There are a number of shell environment variable groups:
12
13                     PNG driver
14
15                     PS driver (PostScript)
16
17                     variables for direct rendering
18
19                     variables for internal use
20       Any setting which needs to be modifiable by a GRASS program (e.g. MONI‐
21       TOR) has to be a GRASS gisenv variable.
22
24       GRASS maintains some settings in a number of files on the system.  They
25       are detailed below.
26

Setting environment variables

28       Setting environment variables depends on the shell being used:
29         Bash:     export VARIABLE=value
30          or
31         Csh:      setenv VARIABLE value
32          or
33         Cmd.exe (Windows): set VARIABLE=value
34

Setting environment variables permanently

36                     To  get  personal  BASH shell definitions (aliases, color
37                     listing option, ...)  into GRASS, store them in:
38                     $HOME/.grass.bashrc
39
40                     To get personal CSH  shell  definitions  (aliases,  color
41                     listing option, ...)  into GRASS, store them in:
42                     $HOME/.grass.cshrc
43

Setting GRASS variables

45       Use  "g.gisenv"  within  GRASS. This permanently predefines GRASS vari‐
46       ables in the .grassrc6 file.
47
48       Usage:
49
50       g.gisenv set="VARIABLE=VALUE"
51
52
53       It looks unusual with two equals signs, but g.gisenv serves  dual  duty
54       for getting and setting GRASS variables.
55
56       If  the user just specifies a variable name, it defaults to "get" mode.
57       For example:
58
59       GRASS ~> g.gisenv GRASS_GUI
60       text
61
62

List of selected (GRASS related) environment variables

64       [ To be set from the terminal shell or startup scripts ]
65
66       GISBASE
67         directory where GRASS lives. This is set automatically by the startup
68       script.
69
70       GISRC
71         name  of  .grassrc6 file. GISRCRC defines the system wide value while
72       in a GRASS session.
73
74       GRASS_ADDON_PATH
75       [grass startup script]
76         allows to specify additional paths to local GRASS  modules  extra  to
77       standard distribution.
78
79       GRASS_ADDON_ETC
80       [libgis, g.findetc]
81         specify  paths  where  support  files (etc/) may be found external to
82       standard distribution.
83
84       GRASS_BATCH_JOB
85         defines the name (path) of a shell script to be  processed  as  batch
86       job.
87
88       GRASS_ERROR_MAIL
89         set  to  any value to send user mail on an error or warning that hap‐
90       pens while stderr is being redirected.
91
92       GRASS_GNUPLOT
93       [i.spectral]
94         program to use for plotting "gnuplot" data
95
96       GRASS_GUI
97         either "text" or "tcltk" to define non-/graphical startup.  Can  also
98       specify  the  name of the GUI to use, e.g. "gis.m", "d.m" or "wxpython"
99       (wx name subject to change). Also exists as  a  GRASS  gisenv  variable
100       (see  below).  If  this shell variable exists at GRASS startup, it will
101       determine the GUI used. If it is not defined startup  will  default  to
102       the last GUI used.
103
104       GRASS_FONT_CAP
105       [g.mkfontcap, d.font, display drivers]
106         Specifies  an  alternative location (to $GISBASE/etc/fontcap) for the
107       font configuration file.
108
109       GRASS_HEIGHT
110       [d.mon]
111         defines the height of GRASS monitor, see also GRASS_WIDTH
112
113       GRASS_HTML_BROWSER
114       [init.sh, d.m, gis.m]
115         defines name of HTML browser.  For most platforms this should  be  an
116       executable in your PATH, or the full path to an executable.
117       Mac  OS  X  runs  applications  differently  from  the CLI.  Therefore,
118       GRASS_HTML_BROWSER should be the application's signature,  which  is  a
119       domain-like  name,  just  reversed.  ie:  com.apple.Safari.  To find an
120       application's signature, type the following in a Terminal (fill in  the
121       path  to  the application you are interested in, for example: /Applica‐
122       tions/Safari.app):
123       grep   -A    1    "CFBundleIdentifier"    /path/to/application.app/Con‐
124       tents/Info.plist
125       The signature is the following the , without the bracketing  tags.
126
127       GRASS_INT_ZLIB
128       [libgis]
129         If  the  environment  variable  GRASS_INT_ZLIB exists, new compressed
130       rasters will be compressed using zlib instead of RLE compression.  Such
131       rasters will have a "compressed" value of 2 in the cellhd file.
132       Obviously,  decompression  is  controlled  by the raster's "compressed"
133       value, not the environment variable.
134
135       GRASS_MESSAGE_FORMAT
136       [various modules]
137       Maybe set to either "standard" or "gui" (normally GRASS takes care)
138
139       GRASS_MOUSE_BUTTON
140       [various modules]
141         swaps mouse buttons for two-button or left-handed mice. Its value has
142       three  digits  1,  2,  and 3, which represent default left, middle, and
143       right buttons respectively. Setting to "132" will swap middle and right
144       buttons.  Note that this variable should be set before a display driver
145       is initialized (e.g., d.mon x0).
146
147       GRASS_PAGER
148       [various modules]
149       Maybe set to either "less" or "more"
150
151       GRASS_PERL
152       [Used during install process for generating man pages]
153         set perl with path
154
155       GRASS_RND_SEED
156         set random seed for r.mapcalc rand() function
157
158       GRASS_SH
159       [shell scripts on Windows]
160       Path to bourne shell interpreter used to run shell scripts
161
162       GRASS_TCLSH
163       [nviz]
164         set tclsh shell name to override 'tclsh'
165
166       GRASS_XTERM
167       lib/init/grass-xterm-wrapper
168       lib/init/grass-xterm-mac
169         set to any value (e.g. rxvt, aterm, gnome-terminal, konsole) to  sub‐
170       stitute  'x-terminal-emulator'  or  'xterm'.  The  Mac OS X app startup
171       defaults to an internal '$GISBASE/etc/grass-xterm-mac', which  emulates
172       the necessary xterm functionality in Terminal.app.
173
174       GRASS_UI_TERM
175         set to any value to use the terminal based parser
176
177       GRASS_VERSION
178         reports the current version number (used by R-stats interface etc);
179         should not be changed by user
180
181       GRASS_WIDTH
182       [d.mon]
183         defines the width of GRASS monitor, see also GRASS_HEIGHT
184
185       GRASS_WISH
186       [d.m, nviz]
187         set wish shell name to override 'wish'
188
189       GRASS_NO_GLX_PBUFFERS
190       [nviz]
191         set to any value to disable the use of Pbuffers
192
193       GRASS_NO_GLX_PIXMAPS
194       [nviz]
195         set to any value to disable the use of GLX Pixmaps
196
197   List of selected GRASS PNG driver environment variables
198       [ These variables control the function of the PNG Driver. ]
199
200       GRASS_PNGFILE
201         name  of  PNG  output file. If it ends with ".ppm" a PPM file will be
202       created.
203
204       GRASS_WIDTH
205         defines the width of GRASS monitor, see also GRASS_HEIGHT
206
207       GRASS_HEIGHT
208         defines the height of GRASS monitor, see also GRASS_WIDTH
209
210       GRASS_BACKGROUNDCOLOR
211         defines the background color of the image created by the PNG driver
212
213       GRASS_TRANSPARENT
214         if "TRUE", the image created by the PNG driver will have a  transpar‐
215       ent background
216
217       GRASS_PNG_COMPRESSION
218         compression level of PNG files (0 = none, 1 = fastest, 9 = best)
219
220       GRASS_TRUECOLOR
221         if "TRUE", the PNG driver generates a true-color image
222
223       GRASS_PNG_AUTO_WRITE
224         tells  the  PNG driver to write the image to a file whenever a client
225       disconnects, rather than waiting until you stop the monitor
226
227       GRASS_PNG_READ
228         if "TRUE", the PNG driver will initialize the image from the contents
229       of $GRASS_PNGFILE
230
231       GRASS_PNG_MAPPED
232         if "TRUE", the PNG driver will map $GRASS_PNGFILE as its framebuffer,
233       rather than using memory; this only works with BMP files
234
235   List of selected GRASS PS driver environment variables
236       [ These variables control the function of the PS Driver. ]
237
238       GRASS_PSFILE
239         name of output file. If it ends with ".eps" an EPS file will be  cre‐
240       ated.
241
242       GRASS_PAPER
243         sets  the screen dimensions and margins to fit a standard paper size,
244       see also GRASS_WIDTH, GRASS_HEIGHT.
245
246       GRASS_WIDTH
247         defines the width of the screen, see also GRASS_HEIGHT
248
249       GRASS_HEIGHT
250         defines the height of the screen, see also GRASS_WIDTH
251
252       GRASS_TRUECOLOR
253         if "TRUE", the PS driver  generates  color  output,  otherwise  mono‐
254       chrome.
255
256       GRASS_LANDSCAPE
257         if "TRUE", the screen is rotated 90 degrees counter-clockwise so that
258       a "landscape" screen fits better on "portrait" paper.
259
260       GRASS_PS_HEADER
261         if "FALSE", the output is appended to any existing file, and no  pro‐
262       log or setup sections are generated.
263
264       GRASS_PS_TRAILER
265         if "FALSE", no trailer section is generated.
266
267   List of selected GRASS environment variables for direct rendering
268       [ In addition to those which are understood by the PNG Driver, the fol‐
269       lowing variables affect direct rendering. ]
270
271       GRASS_RENDER_IMMEDIATE
272         tells the raster library to use its  built-in  PNG/PS  driver  rather
273       than  connecting  to  an  external  monitor  process  using sockets. If
274       GRASS_RENDER_IMMEDIATE=TRUE is set, there is  no  need  to  run  "d.mon
275       start=PNG"
276
277       GRASS_FONT
278         specifies  the  font  as  either  the  name  of  a  font  from  $GIS‐
279       BASE/etc/fontcap   (or   alternative   fontcap   file    specifed    by
280       GRASS_FONT_CAP),  or  alternatively  the  full  path to a FreeType font
281       file.
282
283       GRASS_ENCODING
284         the encoding to be assumed for text which is drawn using  a  freetype
285       font; may be any encoding know to "iconv".
286
287   List of selected internal GRASS environment variables
288       [ These variables are intended for internal use only by the GRASS soft‐
289       ware to facilitate communiction between the GIS engine, GRASS  scripts,
290       and  the  GUI.   The user should not set these in a GRASS session. They
291       are meant to be set locally for specific commands. ]
292
293       GRASS_OVERWRITE
294       [all modules]
295         toggles map overwrite.
296
297                      0 - maps are protected (default),
298
299                      1 - maps with identical names will be overwritten.
300       This variable is automatically created by g.parser so that the "--over‐
301       write"  option  will  be  inherited  by dependant modules as the script
302       runs. Setting either the GRASS_OVERWRITE environment  variable  or  the
303       OVERWRITE gisenv variable detailed below will cause maps with identical
304       names to be overwritten.
305
306       GRASS_VERBOSE
307       [all modules]
308         toggles verbosity level
309
310                      0 - only errors and warnings are printed
311
312                      1 - progress messages are printed (percent complete)
313
314                      2 - all module messages are printed
315
316                      3 - additional verbose messages are printed
317       This variable is automatically created by g.parser so that the  "--ver‐
318       bose"  or "--quiet" flags will be inherited by dependant modules as the
319       script runs.
320
321       GRASS_REGION
322       [libgis]
323         Override region settings, separate parameters with a ";".  Format  is
324       the same as in the WIND region settings file. Otherwise use is the same
325       as WIND_OVERRIDE.
326
327       WIND_OVERRIDE
328       [libgis]
329
330       It causes programs to use the specified named region (created with e.g.
331       "g.region  save=...")  to be used as the current region, instead of the
332       region from the WIND file.
333       This allows programs such as gis.m  to  run  external  commands  on  an
334       alternate  region without having to modify the WIND file then change it
335       back afterwards.
336

List of selected GRASS gisenv variables

338       [ Use g.gisenv to get/set/unset/change them ]
339
340       DEBUG
341       [entire GRASS]
342         sets level of debug message output (0: no debug messages)
343       g.gisenv set=DEBUG=0
344
345       DM_FORM_MODE
346       [d.m]
347         sets default form mode (txt or gui)
348       g.gisenv set=DM_FORM_MODE=txt
349
350       GISDBASE
351         initial database
352
353       GIS_LOCK
354         lock ID to prevent parallel GRASS use,
355         process id of the start-up shell script
356
357       GRASS_DB_ENCODING
358       [d.what.vect/forms library]
359         encoding of query form (utf-8, ascii, iso8859-1, koi8-r)
360
361       GRASS_GUI
362         either "text" or "tcltk" to define non-/graphical startup.  Can  also
363       specify  the  name of the GUI to use, e.g. "gis.m", "d.m" or "wxpython"
364       (wx name subject to change). Can also exist as a  GRASS  startup  shell
365       variable.  The  gisenv setting defines what GUI GRASS will use the next
366       time it starts.
367
368       LOCATION
369        full path to location directory
370
371       LOCATION_NAME
372        initial location name
373
374       MAPSET
375         initial mapset
376
377       OVERWRITE
378       [all modules]
379         toggles map overwrite.
380           With 0 maps are protected (default),
381           With 1 maps with identical names will be overwritten.
382         Example: g.gisenv set="OVERWRITE=0"
383         You can force an overwrite for an individual command by adding  "--o"
384       to the command:
385         r.in.gdal --o output=existing_map ...
386
388       $HOME/.grassrc6
389         stores the GRASS variables (but not environment variables)
390
391       $HOME/.grasslogin6
392          stores  the  DBMI  passwords in this hidden file Only the file owner
393       can access this file.
394
395       $HOME/GIS_ERROR_LOG
396         If this file exists then all GRASS error  and  warning  messages  are
397       logged here. Applies to current user. To generate the file, use:
398          touch $HOME/GIS_ERROR_LOG
399
400       $GISBASE/GIS_ERROR_LOG
401         If  this  file  exists  then all GRASS error and warning messages are
402       logged here. Applies to all users. (proper write permissions must be in
403       place)
404
405       Note:  Error and warning messages encountered while using the GUI menus
406       are not logged.
407
408   SEE ALSO
409        g.gisenv, g.parser
410
411       Last changed: $Date: 2008-04-15 19:10:05 +0200 (Tue, 15 Apr 2008) $
412
413       Help Index
414
415
416
417GRASS 6.3.0                                                       variables(1)
Impressum