Pedro Roma wrote:

> > > I'm developing a few scripts but a few r.mapcalc lines will depend on the
> > > location and mapset. I mean, I will have different factors for different
> > > Locations and mapsets.
> > > Is there any variables with location names and mapsets?
> > > And is it possibvle to use in if setences in GRASS Bash scripts or even
> > in
> > > PERL Scripts? (I suppose So)
> >
> > You can query GRASS variables using g.gisenv. You can set shell
> > variables with e.g.:
> >
> >        MAPSET=`g.gisenv get=MAPSET`
> 
> Ok this is the easiest way to retrieve Location and Mapset in a Script
> right?

Yes.

> And I can use it in a If sentence without any problems?

The shell expands variables within double-quoted strings and within
here documents, so you can use e.g.:

        r.mapcalc " ... $MAPSET ..."
or:
        r.mapcalc <<EOF
        ...
        ... $MAPSET ...
        ...
        EOF

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to