[GRASS-dev] script output for g.list

Martin Landa landa.martin at gmail.com
Tue Sep 4 05:37:54 EDT 2007


Hi Michael,

I tried to modify g.list. Instead of G_list_element(), the patch call
G_list() and G_ls_format() .

Patch attached (not committed to CVS).

E.g.

$ g.list rast
----------------------------------------------
raster files available in mapset <martin>:
asp
----------------------------------------------
raster files available in mapset <PERMANENT>:
aspect          elevation.dem   fields          landuse         roads
         soil.br.depth   soils.ph        strm.dist       trn.sites
bugsites        elevation.dted  geology         owner
rstrct.areas    soils           soils.range     texture         uparea
density         erode.index     landcover.30m   quads
rushmore        soils.Kfactor   spot.image      tractids
vegcover
elevation.10m   erosion1        landcover.orig  railroads       slope
         soils.Tfactor   streams         transport.misc

$ g.list rast --q
asp
aspect
bugsites
density
elevation.10m
elevation.dem
elevation.dted
erode.index
erosion1
fields
geology
landcover.30m
landcover.orig
landuse
owner
quads
railroads
roads
rstrct.areas
rushmore
slope
soil.br.depth
soils
soils.Kfactor
soils.Tfactor
soils.ph
soils.range
spot.image
streams
strm.dist
texture
tractids
transport.misc
trn.sites
uparea
vegcover

Martin

2007/9/3, Michael Barton <michael.barton at asu.edu>:
>
>  Awhile ago, I think g.mlist output was changed so that it sent out a single
> list of maps or other GIS elements rather than a multicolumn list. Is there
> a way to add a flag to g.list so that it can produce output in the same way?
>
>  As it is, the output of g.list cannot easily be parsed within a script
> because of it's multicolumn output. If the output could be a nice, clean
> single list, it *would* be parsable. Within a script, g.list is preferable
> over g.mlist for finding all relevant files in a mapset because it seems
> considerably faster.
>
>  Michael
>  __________________________________________
>  Michael Barton, Professor of Anthropology
>  Director of Graduate Studies
>  School of Human Evolution & Social Change
>  Center for Social Dynamics & Complexity
>  Arizona State University
>
>  phone: 480-965-6213
>  fax: 480-965-7671
>  www: http://www.public.asu.edu/~cmbarton
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev
>


-- 
Martin Landa <landa.martin at gmail.com> * http://gama.fsv.cvut.cz/~landa *
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g-list-vq.diff.gz
Type: application/x-gzip
Size: 1975 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20070904/c0b116a3/g-list-vq.diff.gz


More information about the grass-dev mailing list