[GRASS-dev] r.sum - parsable for shell scripts

Maciej Sieczka tutey at o2.pl
Sun Nov 26 13:39:58 EST 2006


Jachym Cepicky wrote:
> Hi,
> 
> r.sum produced result with spaces:
> SUM = 8787936.000000
> 
> which makes it hard parable for shell scripts:
> eval `r.sum rast=soils --q`
> bash: SUM: command not found
> 
> IMHO there is no barrier to remove this white spaces, so the that result
> looks like 
> SUM=8787936.000000
> 
> and one can easily perform something like 
> eval `r.sum rast=soils --q`
> echo $SUM
> 8787936.000000
> 
> I allready sent this to cvs - I'm just asking, to be sure.

Jachym,

This is certainly a good approach what you have done, but I'm not
really sure such changes should be allowed during 6.x. Maybe postpone
it until GRASS 7? There might be users scripts that use r.sum and we
never know how they parse r.sum's output. But maybe I'm just too
cautious. What do others think?

Thanks for the huge portion of your recent cleanups and fixes in the
CVS! Great job!

All Best,
Maciek




More information about the grass-dev mailing list