[GRASS-user] csh syntax

I found the bash command for adding up rasters as
$str="r.mapcalc map=ts.1"
$for i in `seq ts.2 ts.120`; do
str=$str+" + map$i", done

I need this exact command, but in csh I have been playing with the syntax and cannot seem to get it to work. I know I will switch out "for i in" for like foreach, but the "str" command is not interchangable, and neither is the "seq" command.

Any suggestions are greatly appreciated.
Aaron

Try this:

set i=1
set str="r.mapcalc map=ts.1"

while($i <= 120)
  set str="$str + map.$i"
  @ i++
end

echo $str

--Wolf

On 12.07.2007 17:57, goldneaa@onid.orst.edu wrote:

I found the bash command for adding up rasters as
$str="r.mapcalc map=ts.1"
$for i in `seq ts.2 ts.120`; do
str=$str+" + map$i", done

I need this exact command, but in csh I have been playing with the
syntax and cannot seem to get it to work. I know I will switch out "for
i in" for like foreach, but the "str" command is not interchangable, and
neither is the "seq" command.

Any suggestions are greatly appreciated.
Aaron

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

--

<:3 )---- Wolf Bergenheim ----( 8:>