[GRASS-dev] Re: r49205 - in grass/trunk: lib/python raster/r.info

Hamish hamish_b at yahoo.com
Sun Nov 27 20:18:28 EST 2011


Martin:
> >> I would still incline to use `-g` for shell
> >> script output as used in others modules.
> >> I have counted more than 45 modules in trunk
> >> which use `-g` for shell script style output.

Hamish:
> > huh? I don't understand what you are talking about.

Martin: 
> OK, sorry for wrong counting, there are 68 GRASS modules
> with `g` flag (in trunk), from them 16 uses `g` flags for
> shell script style output. Note that in most cases the
> modules which prints something to the stdout uses `g` flag
> for shell script style output. So I hoped that my question
> is clear, why should be r.info and v.info exceptions?

?! they aren't !?

> I think it would be good decision to reserve `g` flag for
> shell script output in the case that modules serves such
> output.

But -g for r.info and v.info *do* output shell script style.

so I still don't understand what you are trying to say.


"Extra/esoteric" metadata items moved into -e are generally not
safe to use directly in shell scripts as many of them can contain
freeform text fields. It took me less than 48 hours to run across
that problem in the wild when all output was merged into one flag.
(bash/eval does not like title= for pretty much any raster map)

Working around that by quoting all strings in the output does not
seem very language-portable to me. (making it nicer for shell scripts
should not make it much more of a pain to parse in python scripts,
and vice versa)


Hamish


More information about the grass-dev mailing list