[GRASS-dev] g.region print flags combination

Maciej Sieczka tutey at o2.pl
Tue Jan 2 11:52:03 EST 2007


Martin Landa wrote:
> Hi,
> 
> I hope, now it is fixed in CVS.

Martin,

"g.region -g" works OK now, but it prints a WARNING message on the top.
It also prints few extra lines, compared to before, namely:

projection=1
zone=34
datum=wgs84
ellipsoid=wgs84

Your WARNING message is correct and desired, as well as the extra info
 is usefull, but those several additional lines might brake some user's
scripts.

Unless the script parses the "g.region -g" output something like "eval
`g.region -g`", it might fail to parse it as intended. And although
using eval in scripts is the best option, we shouldn't assume the user
doesn't do it some other way.

E.g my r.surf.nnbathy parses "g.region -g" with awk instead of eval,
because I din't know eval when I was writing the script. I only knew
how to do it with awk, and it worked fine (anyway, a fixed version
using eval should be online tonight).

See also
http://www.nabble.com/r.sum---parsable-for-shell-scripts-tf2707790.html#a7549849

I'd like to ask GRASS folks what you think about it - should the
"g.region -g" output change during the GRASS 6.3? I guess these changes
should wait for 7.

Cheers,
Maciek




More information about the grass-dev mailing list