[GRASS-dev] [GRASS GIS] #3462: Allow setting environment variables in grass startup script

GRASS GIS trac at osgeo.org
Tue Dec 19 03:28:37 PST 2017

#3462: Allow setting environment variables in grass startup script
  Reporter:  mankoff      |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  major        |  Milestone:
 Component:  Default      |    Version:  7.2.2
Resolution:               |   Keywords:
       CPU:  Unspecified  |   Platform:  MacOSX

Comment (by martinl):

 Replying to [comment:10 mankoff]:

 > I get that as mentioned earlier, environment variables should be loaded
 by `load_env()`. But  nobody has offered an explanation for why `export`
 statements are ignored here. GRASS is,

 Well, then it's up to you to help us discovering where the problem is.
 Nobody else was able till now to reproduce this bug. Than it's hard to

 > generally, a power user tool and lets the users do what they want. Why
 is it acting in such a protective manner here?

 Instead of hacking around it would be nice to find out why `load_env()` is
 not working in your case.

 > $ GRASS_DEBUG=ON  grass72 -c EPSG:3413 ./Gtmp
 > DEBUG: GRASS_DEBUG environmental variable is set. It is meant to be an
 internal variable for debugging only this script.
 >  Use 'g.gisenv set="DEBUG=[0-5]"' to turn GRASS GIS debug mode on if you
 wish to do so.
 > DEBUG: Environmental variable set BAR=42
 > DEBUG: Environmental variable set

 Looks OK.

 > .grass.bashrc
 > .grass7/bashrc

 Such lines are not printed in my case.

 > GRASS 7.2.2 (Gtmp):~ > env | grep BAR
 > BAR=42

 > GRASS 7.2.2 (Gtmp):~ > env | grep DY
 > GRASS 7.2.2 (Gtmp):~ >

 Please attach your `.grass7/bashrc` file.

Ticket URL: <https://trac.osgeo.org/grass/ticket/3462#comment:11>
GRASS GIS <https://grass.osgeo.org>

More information about the grass-dev mailing list