I went look in r.shade.relief, so I changed

if [ -z `g.findfile elem=cell file="$GIS_OPT_SLOPE" | grep ^file | cut
-f2 -d=` ] ; then
   g.message -e "<$GIS_OPT_SLOPE> does not exist! Aborting."
   exit 1
fi

by
slope=$GIS_OPT_SLOPE

eval `g.findfile element=cell file=$slope`
if [ -z "$name" ] ; then
  g.message -e  "Map <$slope> not found! Aborting."
  exit 1
fi

and now it works fine.

thanks

Carlos



On 7/2/07, Harri Kiiskinen <[EMAIL PROTECTED]> wrote:
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 '[EMAIL PROTECTED]' should be done:

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

whereas your script seems to do:

g.findfile element=cell file='[EMAIL PROTECTED]'

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 '[EMAIL PROTECTED]'. 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.

_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev



--
+-----------------------------------------------------------+
             Carlos Henrique Grohmann - Guano
 Visiting Researcher at Kingston University London - UK
 Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
Linux User #89721  - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to