[GRASS5] [bug #1075] (grass) bug in r.mapcalc

Markus Neteler neteler at itc.it
Fri May 31 12:05:00 EDT 2002


On Fri, May 31, 2002 at 03:55:27PM +0100, Glynn Clements wrote:
> 
> Request Tracker wrote:
[...]
> > Problem #3 (or just a note): in a command mode, r.mapcalc behaves
> > differently than a few months ago. Now you must have a command
> > without spaces around "=" while in the past this command worked OK:
> > 
> > GRASS:~ > r.mapcalc flow.dx = "flow * cos(aspect)"
> 
> I can implement that easily enough.

Thanks Glynn. This saves us from rewriting lots of scripts and
docs. I just tested:

GRASS:~/cvsgrass_exp > r.mapcalc test="34-43"
test = (sub(34,43))
   3%...
GRASS:~/cvsgrass_exp > r.mapcalc "test=34-43"
test = (sub(34,43))
   3%...

nice.

> However, given that you have to quote most of the command (e.g. to
> prevent '*' being expanded by the shell), you may as well just quote
> the whole thing, i.e.
> 
> 	r.mapcalc "flow.dx = flow * cos(aspect)"

Really? For my bash it works:

r.mapcalc test="34  * 43"
test = (mul(34,43))

> [Actually, single quotes are preferable.]

Markus



More information about the grass-dev mailing list