File: variables.html

package info (click to toggle)
grass 6.0.2-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 40,044 kB
  • ctags: 31,303
  • sloc: ansic: 321,125; tcl: 25,676; sh: 11,176; cpp: 10,098; makefile: 5,025; fortran: 1,846; yacc: 493; lex: 462; perl: 133; sed: 1
file content (232 lines) | stat: -rw-r--r-- 6,286 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GRASS variables and environment variables</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="white">

<H2>GRASS variables and environment variables</H2>

<!-- file source:
     ./lib/init/variables.html
-->

<P>
There are two types of variables:
<ul>
<li>environment variables,</li>
<li>GRASS variables.</li>
</ul>

Any setting which needs to be modifiable by a GRASS program (e.g. MONITOR)
has to be a GRASS variable.

<h2>Setting environment variables</h2>

<br>Setting environment variables depends on the shell being used:
<br>&nbsp;&nbsp;Bash:&nbsp;&nbsp;&nbsp;&nbsp; <tt>export VARIABLE=value</tt>
<br>&nbsp;&nbsp;&nbsp;or
<br>&nbsp;&nbsp;Csh:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tt>setenv VARIABLE value</tt>

<h2>Setting environment variables permanently</h2>
<ul>
<li>
To get personal BASH shell definitions (aliases, color listing option, ...)
into GRASS, store them in:<br>
<tt>$HOME/.grass.bashrc</tt></li>

<li>
To get personal CSH shell definitions (aliases, color listing option, ...)
into GRASS, store them in:<br>
<tt>$HOME/.grass.cshrc</tt></li>
</ul>


<h2>Setting GRASS variables</h2>
You have to use "g.gisenv" (within GRASS which then permanently predefines
GRASS variables in the <tt>.grassrc6</tt> file):<br>
<p>
Use: &nbsp;&nbsp;&nbsp; <tt>g.gisenv set=VARIABLE=VALUE</tt>

<p>

It looks unusual with two equals signs, but g.gisenv does dual duty for
getting and setting GRASS variables.
<P>
If the user just specifies a variable name, it defaults to "get" mode. Example:
<p>
<tt>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GRASS ~> g.gisenv GRASS_GUI<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text
</tt>


<hr WIDTH="100%">
<h2>List of selected (GRASS related) environment variables</h2>

<p>GISBASE
<br>&nbsp; directory where GRASS lives

<p>GISRC
<br>&nbsp; name of .grassrc6 file

<p>GRASS_ADDON_PATH
<br>[grass5] startup script
<br>&nbsp; allows to specify additional paths to local GRASS modules extra to standard distribution

<p>GRASS_ANOTHER_BUTTON
<br>[various modules]
<br>&nbsp; If the environment variable GRASS_ANOTHER_BUTTON exists,
 the mouse button setting will be changed for two-button mice.

<p>GRASS_BACKGROUNDCOLOR
<br>[PNGdriver]
<br>&nbsp; defines the background color of the image created by the PNG driver

<p>GRASS_ERROR_MAIL
<br>&nbsp; set to any value to send user mail on an error or warning that 
 happens while stderr is being redirected.

<p>GRASS_GNUPLOT
<br>[m.svfit, s.probplt, s.sv]
<br>&nbsp; program to use for plotting "gnuplot" data

<p>GRASS_HEIGHT
<br>[d.mon]
<br>&nbsp; defines the height of GRASS monitor, see also GRASS_WIDTH

<P>GRASS_HTML_BROWSER
<br>[init.sh, d.m]
<br>&nbsp; defines name of HTML browser

<P>GRASS_INT_ZLIB
<br>[libgis]
<br>&nbsp; If the environment variable GRASS_INT_ZLIB exists, new compressed
 rasters will be compressed using zlib instead of RLE compression. Such
 rasters will have a "compressed" value of 2 in the cellhd file.<br>
 Obviously, decompression is controlled by the raster's "compressed"
 value, not the environment variable.

<p>GRASS_MESSAGE_FORMAT
<br>[various modules]
<br>Maybe set to either "standard" or "gui" (normally GRASS takes care)

<p>GRASS_PAGER
<br>[various modules]
<br>Maybe set to either "less" or "more"

<p>GRASS_PERL
<br>&nbsp; set perl with path

<p>GRASS_PNGFILE
<br>[PNGdriver]
<br>&nbsp; name of PNG output file

<!-- HB Sept 2005: I don't think this exists anymore:
<p>GRASS_STDERR
<br>&nbsp; set to any value to prevent user mail on error
-->

<p>GRASS_TCLSH
<br>[nviz]
<br>&nbsp; set tclsh shell name to override 'tclsh'

<p>GRASS_TRANSPARENT
<br>[PNGdriver]
<br>&nbsp; if "TRUE", the image created by the PNG driver will have a transparent background

<p>GRASS_TRUECOLOR
<br>[PNGdriver]
<br>&nbsp; if "TRUE", the PNG driver generates a true-color image

<p>GRASS_UI_TERM
<br>&nbsp; set to any value to use the terminal based parser

<p>GRASS_VERSION
<br>&nbsp; reports the current version number (used by R-stats interface etc);
<br>&nbsp; should not be changed by user

<p>GRASS_WIDTH
<br>[d.mon]
<br>&nbsp; defines the width of GRASS monitor, see also GRASS_HEIGHT

<p>GRASS_WISH
<br>[d.m, nviz]
<br>&nbsp; set wish shell name to override 'wish'


<h2>List of selected GRASS variables</h2>

[ Use <tt>g.gisenv</tt> to set/unset/change them ]

<p>DEBUG
<br>[entire GRASS]
<br>&nbsp; sets level of debug message output (0: no debug messages)
<br><tt>g.gisenv set=DEBUG=0</tt>

<p>DM_FORM_MODE
<br>[d.m]
<br>&nbsp; sets default form mode (txt or gui)
<br><tt>g.gisenv set=DM_FORM_MODE=txt</tt>

<p>GISDBASE
<br>&nbsp; initial database

<p>GIS_LOCK
<br>&nbsp; lock ID to prevent parallel GRASS use,
<br>&nbsp; process id of the start-up shell script

<p>GRASS_DB_ENCODING
<br>[d.what.vect/forms library]
<br>&nbsp; encoding of query form (utf-8, ascii, iso8859-1, koi8-r)

<p>GRASS_GUI
<br>&nbsp; either "text" or "tcltk" to define non-/graphical startup

<p>LOCATION
<br>&nbsp;full path to location directory

<p>LOCATION_NAME
<br>&nbsp;initial location name

<p>MAPSET
<br>&nbsp; initial mapset

<p>OVERWRITE
<br>[all modules]
<br>&nbsp; toggles map overwrite.
<br>&nbsp; &nbsp; With 0 maps are protected (default), 
<br>&nbsp; &nbsp; With 1 maps with identical names will be overwritten.
<br>&nbsp; You can force a protected overwrite by adding "--o" to the command.
<br>e.g.:
<br>&nbsp;<tt>g.gisenv set="OVERWRITE=0"</tt>


<h2>GRASS-related Files</h2>

<p>$HOME/.grassrc6
<br>&nbsp; stores the GRASS variables (but not environment variables)

<p>$HOME/GIS_ERROR_LOG
<br>&nbsp; If this file exists then all GRASS error and warning messages are 
 logged here. Applies to current user. To generate the file, use:
<br>&nbsp;&nbsp; <tt>touch $HOME/GIS_ERROR_LOG</tt>

<p>$GISBASE/GIS_ERROR_LOG
<br>&nbsp; If this file exists then all GRASS error and warning messages are 
 logged here. Applies to all users. (proper write permissions must be in place)
<P>
<i>Note:</i>
Error and warning messages encountered while using the GUI menus are not logged.


<h3>SEE ALSO</h3>

<a href="g.gisenv.html">g.gisenv</a>


<p><i>Last changed: $Date: 2005/09/23 04:52:24 $</i>
<HR>
<P><a href=index.html>Help Index</a></p>
</body></html>