<!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">
I Think I have managed to use TMP files but I'm getting a few errors
that I can't understand. I'm using multiple GIS_OPT_INPUT and I want to
add them to GIS_OPT_COUNTER<br>
<br>
r.mapcalc $GIS_OPT_COUNTER= "float (0)"<br>
<br>
IFS=,<br>
for opt in $GIS_OPT_INPUT; do<br>
&nbsp;&nbsp;&nbsp; TMP1=`g.tempfile pid=$$`<br>
&nbsp;&nbsp;&nbsp; echo $TMP1<br>
&nbsp;&nbsp;&nbsp; r.mapcalc $TMP1= "$GIS_OPT_COUNTER+$opt"<br>
&nbsp;&nbsp;&nbsp; r.mapcalc $GIS_OPT_COUNTER= "$TMP1"&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; rm -f $TMP1<br>
done<br>
<br>
And I'm getting the following errors:<br>
<b>syntax error, unexpected ':', expecting '='<br>
Parse error<br>
Invalid map &lt;C&gt;<br>
Parse error<br>
C:/Data/GISDataBase/North-Carolina/landsat/.tmp/3024.0<br>
C:/Data/GISDataBase/North-Carolina/landsat/.tmp/3024.0<br>
syntax error, unexpected ':', expecting '='<br>
Parse error<br>
Invalid map &lt;C&gt;<br>
Parse error</b><br>
<br>
As anyone has an idea of what am i doing wrong?<br>
<br>
Thanks<br>
Best regards,<br>
Antonio<br>
<br>
Ant&oacute;nio Rocha wrote:
<blockquote cite="mid:4B2A43AF.8020309@deimos.com.pt" type="cite">Greetings
Achim
  <br>
You are absolutely right. I made a mistake copying the expression.
  <br>
  <br>
Here it goes:
  <br>
#itinialization of counter1
  <br>
r.mapcalc $GIS_OPT_COUNTER1= "float (0)"
  <br>
  <br>
The cycle:
  <br>
IFS=,
  <br>
for opt in $GIS_OPT_INPUT; do
  <br>
&nbsp; r.mapcalc $GIS_OPT_COUNTER= "$opt+$GIS_OPT_COUNTER"
  <br>
done&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
so the question still remains :)
  <br>
  <br>
Sorry and thanks for your reply.
  <br>
  <br>
Antonio
  <br>
  <br>
</blockquote>
<br>
<BR>
<BR>
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4696 (20091217) __________<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>