[GRASS-dev] formatting expressions for r.mapcalc in GRASS6.4.3

Glynn Clements glynn at gclements.plus.com
Sun Feb 3 09:26:27 PST 2013


Helena Mitasova wrote:

> BTW when you look at the Notes in the manual, the suggestion there
> is to put single quotes around the expression (right side of the
> equation), while the section about raster map layer names explains
> that putting your expression in double quotes will interpret it as a
> raster map name and the floating point section has the quotes as
> used in the book so if somebody is new to GRASS it is easy to get
> confused.

An outer set of quotes should be "consumed" by the shell. Windows'
cmd.exe only accepts double quotes. Unix shells accept either; within
double quotes, most forms of substition still work, while single
quotes cause everything up to the next single quote to be interpreted
literally. The wxGUI command line has its own rules (see shlex.split()
in the Python library documentation).

Map names can be quoted with either single or double quotes, so if the
expression is quoted with double quotes you can quote map names with
single quotes and vice-versa.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list