[GRASS-dev] g.region print flags combination

Martin Landa landa.martin at gmail.com
Tue Jan 2 12:49:07 EST 2007


Hi,

2007/1/2, Maciej Sieczka <tutey at o2.pl>:

> "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.

So should I disable this warning, right?

I think the additional lines would not break any scripts, which parse
`g.region -g` output in a reasonable way (eval, awk) (?).

Regards, Martin

> 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
>


-- 
Martin Landa <landa.martin at gmail.com> * http://gama.fsv.cvut.cz/~landa *




More information about the grass-dev mailing list