On Thu, Mar 5, 2009 at 3:42 PM, achim <a...@jupiter.uni-freiburg.de> wrote: > Hi, > > did someone tried -like me- to use r.mapcalc in a script inside an > do-while-clause? > > I cannot pass changing variables $old, $new like: > r.mapcalc 'river=if(river=$old,$new,null())' > its because of the '', which are needed because if the if-statement.
If you use single quotes '$foo', then the variables are protected. You need to use double quotes: "$foo": r.mapcalc "river=if(river=$old,$new,null())" Markus PS: In GRASS 7, you need white space (at least) before the equal sign: r.mapcalc "river = if(river=$old,$new,null())" (see its manual) _______________________________________________ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user