[GRASSLIST:4434] r.mapcalc and variables

Leonardo Lami lami at faunalia.it
Thu Sep 30 06:20:34 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I'm using the r.mapcalc module inside of a script.
I'm using unix shell commands with constructs for iterative execution (for a 
in - do) and so I have a variable ($a) that I use in the input, output and 
options setting of the GRASS commands.
I have no problem usually but if I use r.mapcalc like in the example I have 
this error message:

GRASS 5.7.cvs:~ > r.mapcalc<<EOF
> 'cost_'$a'_ok'=if(sir_clump!=0,0,'cost_'$a'')
> EOF
parse error, expecting `'=''
Parse error

Someone can explain me how to use variable in r.mapcalc?

Thanks of all

- -- 
Leonardo Lami
lami at faunalia.it            www.faunalia.it
Via Colombo 3 - 51010 Massa e Cozzile (PT), Italy   Tel: (+39)349-1310164
GPG key @: hkp://wwwkeys.pgp.net http://www.pgp.net/wwwkeys.html
https://www.biglumber.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBW93y92hCyP73w7ARAihnAJ4jn1snsiNipqD/v7NS4kjaTRgTmQCfeoXJ
IJmhxZvh5E4WFAjFlT7Sr9w=
=USJ2
-----END PGP SIGNATURE-----




More information about the grass-user mailing list