r.mapcalc script and pipes

Agustin Lobo lobo at Jasper.Stanford.EDU
Mon Jul 19 20:41:03 EDT 1993


If I type
set ima = vegetation1
r.mapcalc res = $ima * $ima

r.mapcalc works without problems, but if I type
r.mapcalc < test

where test is a file whose only line is:
res = $ima * $ ima

then r.mapcalc says <$ima> not found, that is, it does not interpret
$ima as the value of ima. If I write test as,
'res = ' $ima '*' $ima

then r.mapcalc gets confused and me too.

I have to use this piping because r.mapcalc is within a loop in an
script, ima takes different values and the expression actually passed
to r.mapcalc is complex.
Is there any way to get r.mapcalc to interpret $ima when piped?

Thamks,
Agus



More information about the grass-user mailing list