[GRASS-user] how to store results from r.sum with script

Vaclav Petras wenzeslaus at gmail.com
Sat Jan 11 18:11:36 PST 2014


Hi,

I might missed it but I don't know about r.sum module. (I know only r.sun).

Saving standard output of module (if it prints something to standard
output) is the same as for any other command line tool in bash. If the
output is a map (in GRASS) just use it as input to some other module (using
the map name).

Examples bellow show saving outputs of echo command to variables (echo
command just print its parameters to standard output, i.e. to command
line). Working with numbers (additions, multiplications) can be more
difficult (requires different syntax) but there should be some online
guides.

Vaclav


$ A="some text"
$ echo $A
some text

$ B=`echo "this is printed to stdout"`
$ echo $B
this is printed to stdout

$ C=$(echo "this is printed to stdout")
$ echo $C
this is printed to stdout

(lines beginning with $ are lines with command which are meant to by typed
into the command line, the other lines are output)


On Sat, Jan 11, 2014 at 9:32 AM, BLANDENIER Lucien <
lucien.blandenier at unine.ch> wrote:

> Dear all,
>
> I would like to know if there is a way to store results of a calculation
> done with r.sum on many raster with a bash script.
>
> I need to reuse these results in later calculations.
>
> Thanks
>
>
> Lucien
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140111/b90f8604/attachment.html>


More information about the grass-user mailing list