[GRASS-dev] r.rgb: syntax error, unexpected $end, expecting VARNAME or NAME or STRING

Glynn Clements glynn at gclements.plus.com
Fri Mar 18 09:55:32 PDT 2016

Vaclav Petras wrote:

> > ok. But another error occurs (missing error handling if the output
> > names were selected to be identica):
> > ...
> > Perhaps there is an elegant solution to catch the (user) error above?
> Isn't this an issue for every module? I'm not sure if we have a general
> solution (as in the previous case).

Most modules won't explicitly complain if you use the same map name
for multiple outputs, although it's anyone's guess as to what actually
ends up in the map.

I'm reasonably sure that the primary files (cellhd, cell/fcell, null,
f_{format,quant,range} etc) will be consistent, but metadata files
which are written separately (colour table, categories, history, etc)
may be from a different output.

The fact that r.rgb.py fails in this case is really just a
coincidence. It won't complain about using the same name for all
outputs, only for the case where one of the outputs matches the input. 

The error arises because, in r.mapcalc, using a name on the left-hand
side of an assignment causes the name to be interpreted as a variable
rather than as a map, and the r#/g#/b# modifiers can only be applied
to maps, not variables.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list