[GRASS-dev] g.mlist as C implementation?

Hamish hamish_nospam at yahoo.com
Wed Sep 12 23:24:13 EDT 2007


Glynn Clements wrote:
> I had overlooked the part where loop which adds the separator was
> replaced with a call to "tr".
> 
> Technically, this corresponds to a reduction in functionality, as the
> previous version would accept any string as a separator, but using
> "tr" restricts it to a single character (which is probably all that's
> required).

is it possible to use sed instead of tr?
  sed -e "s/\n/$sep/"   # doesn't work

> I've committed an update which has no loops other than the top-level
> "for mapset in $mapsets" loop.

thanks.


I will have a look at merging Martin, Markus and Glynn's suggestions for
a flat output g.list flag. As the feature is needed for parsing, I'd
rather do it as a flag vs. a ncols= option which retains the text and
fancy format mapset underlines. I've never really known what the "g"
stands for, but as we use it a lot for parsable output, the flag will
be '-g' here too.

so it would look like:

G63> g.list -g rast
map1 at user1
map2 at user1
map3 at user1
map_a at PERMANENT
map_b at PERMANENT
map_c at PERMANENT

G63> g.list -gf rast
map1 at user1:
map2 at user1:This map has a title
map3 at user1:
map_a at PERMANENT:Raw x,y,z data binned into a raster grid by cell min
map_b at PERMANENT:Land Use
map_c at PERMANENT:



Once that is firm we can revisit g.mlist to make it fully locale
independent by removing the < grep -vi "files available\|mapset" >
part.


Hamish




More information about the grass-dev mailing list