<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hey<br>
<br>
I have tried Glynn's solution like this:<br>
<br>
r.mapcalc "$GIS_OPT_COUNTER= float(0)"<br>
<pre wrap="">tmp=tmp.myscript.$$</pre>
for opt in $GIS_OPT_INPUT; do<br>
&nbsp;&nbsp;&nbsp; r.mapcalc "$tmp = $opt + $GIS_OPT_COUNTER"<br>
&nbsp;&nbsp;&nbsp; g.rename&nbsp; rast=$tmp,$GIS_OPT_COUNTER<br>
done<br>
<br>
And I got<br>
<b><i>syntax error, unexpected ',', expecting $end<br>
Parse error<br>
raster &lt;tmp.myscript.724&gt; not found</i></b><br>
<br>
I changed myscript to r.ndviserie<i><b> </b></i>(myscript filename)
and i got this:<br>
<i><b>syntax error, unexpected ',', expecting $end<br>
Parse error<br>
raster &lt;tmp.dwe.ndviserie.3692&gt; not found</b></i><br>
<br>
It seems that he is not recognizing tmp as a file where to store an
image. <br>
yesterday I found a reference of initializing TMP files with a
"r_fillnulls_". I try to find this function, or any reference to this,
but nothing was found. What is this?<br>
<br>
Thanks Glynn and everyone else<br>
<br>
Antonio<br>
<br>
Glynn Clements wrote:
<blockquote
 cite="mid:19242.42937.167673.285768@cerise.gclements.plus.com"
 type="cite">
  <pre wrap="">Ant&oacute;nio Rocha wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Greetings Achim
You are absolutely right. I made a mistake copying the expression.

Here it goes:
#itinialization of counter1
r.mapcalc $GIS_OPT_COUNTER1= "float (0)"

The cycle:
IFS=,
for opt in $GIS_OPT_INPUT; do
   r.mapcalc $GIS_OPT_COUNTER= "$opt+$GIS_OPT_COUNTER"
done                      
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Don't use the same map as both input and output. Instead:

        tmp=tmp.myscript.$$
        for opt in $GIS_OPT_INPUT; do
                r.mapcalc "$tmp = $opt + $GIS_OPT_COUNTER"
                g.rename --o rast=$tmp,$GIS_OPT_COUNTER
        done

Although for this specific task (adding a list of maps), use
"r.series ... method=sum".

  </pre>
</blockquote>
<br>
<BR>
<BR>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4698 (20091218) __________<BR>
<BR>
The message was checked by ESET NOD32 Antivirus.<BR>
<BR>
<A HREF="http://www.eset.com">http://www.eset.com</A><BR>


</body>
</html>