[GRASS-dev] how to deal with the @mapset in scripts?

Harri Kiiskinen harkiisk at utu.fi
Mon Jul 2 17:52:58 EDT 2007


On Mon, 2007-07-02 at 22:15 +0100, Carlos "Guâno" Grohmann wrote:
> Helo all,
> 
> I am writing some scripts, but I can't make them work with the @mapset
> in the rasters names. any special trick?
> 
> there is one script attached.

Hello Carlos,

in g.findfile documentation it says, that the mapset has to be set using
its own option, and then it will look in that mapset for the file. The
case 'map1 at mapset1' should be done:

g.findfile element=cell mapset=mapset1 file=map1

whereas your script seems to do:

g.findfile element=cell file='map1 at mapset1'

In the latter case, I guess the g.findfile only looks in the current
mapset, and even thought there might be a file called 'map1' there
probably isn't a file called 'map1 at mapset1'. I guess you probably need
to parse the 'map' option of your script and separate the mapname from
the mapsetname.

Just my theory,

Harri K.




More information about the grass-dev mailing list