[GRASS5] r.mapcalc result

Glynn Clements glynn.clements at virgin.net
Wed May 26 10:50:11 EDT 2004


Radim Blazek wrote:

> Are there any special restrictions for the name of 'result' in r.mapcalc?
> 
> GRASS 5.7.-cvs:~/gdata/devel/raster > r.mapcalc pok-1=1
> parse error, expecting `'=''
> Parse error
> GRASS 5.7.-cvs:~/gdata/devel/raster > r.mapcalc 'pok-1=1'
> parse error, expecting `'=''
> Parse error
> GRASS 5.7.-cvs:~/gdata/devel/raster > r.mapcalc "pok-1=1"
> parse error, expecting `'=''
> Parse error

Names which include r.mapcalc syntatic characters (e.g. minus) have to
be quoted, e.g.:

	r.mapcalc '"pok-1"=1'

	r.mapcalc "'pok-1'=1"

	r.mapcalc "\"pok-1\"=1"

	r.mapcalc
	Enter expressions, "end" when done.
	mapcalc> "pok-1"=1

Etc.

Note: the quotes must be present in the string which is passed to
r.mapcalc; when supplying the string on the command line, you have to
allow for the shell's processing.

The list of characters which can't be used in an unquoted name
consists of control characters, space, and the following:

	^ # @ , " ' ( ) [ ] + - * / % > < ! = & | ? : ;

This is true for both map names and variable names, and is distinct
from GRASS' own restrictions (see G_legal_filename()), which apply
regardless of whether the name is quoted.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list