[GRASS-user] batch export

Bruce Raup brauplists at gmail.com
Sun Aug 24 10:38:17 EDT 2008

If '*index*' is meant to refer to grass rasters, then you need to say
something like:

for out in `g.list rast` ; do
  if [ `echo $out | grep index` ] ; then
    # process $out

If the raster name should begin with 'index' and not just contain the
string, you can say

  if [ `echo $out | grep '^index'` ] ; then

You can use the -i option to grep if you want it to be case-insensitive.

If would be nice if we could pass a file glob pattern to g.list and
have it do the subsetting.


On Sun, Aug 24, 2008 at 4:53 AM, Martin Wegmann
<wegmann at biozentrum.uni-wuerzburg.de> wrote:
> Hello,
> I have a script which imports and processes my data but so far I failed to
> export them again.
> I looked into Dylans blog concerning batch projection [1] but this did not
> help so far.
> The problems is within this statement:
> for out in *index* ; do
> r.out.arc --q in=$out out=${out}_results 2>/dev/null ; done
> I tried it as well with 'for out in * ; do' but only the corresponding rasters
> of files in my current folder are then exported. Hence this statement asks
> for files outside GRASS and not of the current mapset?
> Any idea how to export certain rasters in my current mapset?
> TIA, Martin
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

Bruce Raup

More information about the grass-user mailing list