[GRASS-user] Envtl variables

Martin Landa landa.martin at gmail.com
Tue May 6 14:33:14 EDT 2008


Ciao,

2008/5/6 Agustin Lobo <aloboaleu at gmail.com>:
>  I'm using grass 6.2.3 on ubuntu hardy. I can't get the value
>  of the grass environmental varaibles. If I do g.gisenv. I get:
>  alobo at alobo-laptop:~$ g.gisenv
>  GRASS_GUI=tcltk
>  GISDBASE=/home/alobo/grass/
>  LOCATION_NAME=FBBVA
>  MAPSET=BENI1
>
>  but if I do echo $MAPSET I get a white line.
>
>  How can I get the values of the environmental variables? I'll
>  need them for scripts.

use 'eval'

$ eval `g.gisenv`
$ echo $MAPSET
user1

see e.g.

http://trac.osgeo.org/grass/browser/grass/branches/develbranch_6/scripts/db.dropcol/db.dropcol#L89

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *


More information about the grass-user mailing list