1g.gisenv(1)                 GRASS GIS User's Manual                g.gisenv(1)
2
3
4

NAME

6       g.gisenv  - Outputs and modifies the user’s current GRASS variable set‐
7       tings.
8       Prints all defined GRASS variables if no option is given.
9

KEYWORDS

11       general, settings, variables, scripts
12

SYNOPSIS

14       g.gisenv
15       g.gisenv --help
16       g.gisenv [-sn]  [get=variable[,variable,...]]    [set="variable=value"]
17       [unset=variable[,variable,...]]    [store=string]    [separator=charac‐
18       ter]   [--help]  [--verbose]  [--quiet]  [--ui]
19
20   Flags:
21       -s
22           Use shell syntax (for "eval")
23
24       -n
25           Do not use shell syntax
26
27       --help
28           Print usage summary
29
30       --verbose
31           Verbose module output
32
33       --quiet
34           Quiet module output
35
36       --ui
37           Force launching GUI dialog
38
39   Parameters:
40       get=variable[,variable,...]
41           GRASS variable to get
42
43       set="variable=value"
44           GRASS variable to set
45
46       unset=variable[,variable,...]
47           GRASS variable to unset
48
49       store=string
50           Where GRASS variable is stored
51           Options: gisrc, mapset
52           Default: gisrc
53
54       separator=character
55           Separator for multiple GRASS variables
56           Special characters: pipe, comma, space, tab, newline
57           Default: newline
58

DESCRIPTION

60       When a user runs GRASS, certain variables are set specifying the  GRASS
61       data  base,  location,  mapset,  peripheral device drivers, etc., being
62       used in the current GRASS session. These  variable  name  settings  are
63       recognized as long as the user is running a GRASS session.
64

OPTIONS

66       No prompts are given to the user when running g.gisenv.
67
68       If  run  without  arguments,  g.gisenv  lists all of the user’s current
69       GRASS variable settings. Results are sent to standard output,  and  may
70       look like this:
71       GISDBASE=/opt/grassdata/
72       LOCATION_NAME=nc_spm_08_grass7
73       MAPSET=/user1
74       GUI=gui
75
76       If the user specifies a get=variable_name on the command line
77       g.gisenv MAPSET
78       only the value for that particular GRASS variable is output to standard
79       output. Possible variable names depend on the user’s system, see  vari‐
80       ables  list for details. Note that the variable names are case-insensi‐
81       tive.
82
83       While other variables may be associated with each GRASS session  (e.g.,
84       GRASS_GUI,  GIS_LOCK,  and  other  variables),  those  stated below are
85       essential.
86
87       GISDBASE
88           The GISDBASE is a directory in which  all  users’  GRASS  data  are
89           stored.  Within  the GISDBASE, data are segregated into subdirecto‐
90           ries (called "locations") based on the map coordinate  system  used
91           and  the  geographic extent of the data.  Each "location" directory
92           itself contains  subdirectories  called  "mapsets";  each  "mapset"
93           stores  "data  base  elements"  -  the directories (e.g., the cell,
94           cellhd, vector, etc., directories) in which GRASS  data  files  are
95           actually stored.
96
97       LOCATION_NAME
98           The  user  must  choose  to work with the data under a single GRASS
99           location within any given GRASS  session;  this  location  is  then
100           called the current GRASS location, and is specified by the variable
101           LOCATION_NAME. The LOCATION_NAME is the GRASS  data  base  location
102           whose data will be affected by any GRASS commands issued during the
103           user’s current GRASS session, and is a subdirectory of the  current
104           GISDBASE.  Each  "location" directory can contain multiple "mapset"
105           directories (including the special mapset PERMANENT).  Maps  stored
106           under  the same GRASS LOCATION_NAME (and/or within the same MAPSET)
107           must use the same coordinate system and typically fall  within  the
108           boundaries of the same geographic region (aka, "location").
109
110       MAPSET
111           Each  "mapset" contains a set of maps relevant to the LOCATION_NAME
112           directory in which it appears.  Each LOCATION_NAME can contain mul‐
113           tiple mapsets. (Mapsets which fall under the same LOCATION_NAME all
114           contain data geographically relevant to the LOCATION_NAME, and  all
115           store data in the same map coordinate system.  Frequently, maps are
116           placed into different mapsets to distinguish file ownership - e.g.,
117           each  user  might  have one or more own mapset(s), storing any maps
118           that the user has created and/or are relevant  to  the  own  work.)
119           During  each  GRASS  session, the user must choose one mapset to be
120           the current mapset; the current mapset setting is given by  MAPSET,
121           and is a subdirectory of LOCATION_NAME.  During a single GRASS ses‐
122           sion, the user can use available data in any of the mapsets  stored
123           under  the  current  LOCATION_NAME directory that are in the user’s
124           mapset search path and accessible by the user.  However,  within  a
125           single GRASS session, the user only has write access to data stored
126           under the current mapset (specified by the variable MAPSET).
127
128       Each "mapset" stores GRASS data base elements (i.e., the directories in
129       which  GRASS  data  files are stored).  Any maps created or modified by
130       the user in the current GRASS session will be stored here.  The  MAPSET
131       directory PERMANENT is generally reserved for the set of maps that form
132       the base set for all users working under each LOCATION_NAME.
133
134       Once within a GRASS session, GRASS users have access only to  the  data
135       under  a single GRASS data base directory (the current GRASS data base,
136       specified by the variable GISDBASE), and to  a  single  GRASS  location
137       directory  (the  current  location,  specified  by  the  variable LOCA‐
138       TION_NAME).  Within a single session, the user may only modify the data
139       in  the  current mapset (specified by the variable MAPSET), but may use
140       data available under other mapsets under the same LOCATION_NAME.
141
142       All of these names must be legal names on the user’s current system.
143
144       The full path to the current mapset is determined from GISDBASE,  LOCA‐
145       TION_NAME,   MAPSET   variables,  in  the  example  above:  /opt/grass‐
146       data/spearfish/PERMANENT. The full path can be printed  using  g.gisenv
147       by providing multiple variables:
148       g.gisenv get=GISDBASE,LOCATION_NAME,MAPSET sep=’/’
149       /opt/grassdata/nc_spm_08_grass7/user1
150

NOTES

152       The  output  from  g.gisenv  when invoked without arguments is directly
153       usable by Bash.  The following command will cast each variable into the
154       UNIX environment:
155       eval `g.gisenv`
156       This works only for Bash, sh, ksh, etc. The format of the output is not
157       compatible with some other UNIX shells.
158
159       By default the GRASS variables are stored in  gisrc  file  (defined  by
160       environmental  variable GISRC). If store=mapset is given than the vari‐
161       ables are stored in $GISDBASE/$LOCATION_NAME/$MAPSET/VAR.
162
163   GRASS Debugging
164       To print debugging messages, the variable DEBUG must be  set  to  level
165       equal or greater than 0:
166       g.gisenv set="DEBUG=3"
167       Levels: (recommended levels)
168
169           ·   0 - silence
170
171           ·   1 - message is printed once or few times per module
172
173           ·   3 - each row (raster) or line (vector)
174
175           ·   5 - each cell (raster) or point (vector)
176       To disable debugging messages:
177       g.gisenv unset="DEBUG"
178       The variable DEBUG controls debugging messages from GRASS libraries and
179       modules.
180
181       Similarly WX_DEBUG controls debugging messages from wxGUI.
182

SEE ALSO

184        g.access, g.filename, g.findfile, g.mapsets
185
186       See also variables list
187

AUTHOR

189       Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
190

SOURCE CODE

192       Available at: g.gisenv source code (history)
193
194       Main index | General index | Topics index | Keywords index |  Graphical
195       index | Full index
196
197       © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
198
199
200
201GRASS 7.8.5                                                        g.gisenv(1)
Impressum