[GRASS-user] batch export

Martin Wegmann wegmann at biozentrum.uni-wuerzburg.de
Tue Aug 26 11:10:36 EDT 2008


On Montag, 25. August 2008 19:05:20 Martin Wegmann wrote:
> On Sonntag, 24. August 2008 17:13:17 Martin Landa wrote:
> > Hi,
> >
> > 2008/8/24 Bruce Raup <brauplists at gmail.com>:
> > > 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
> > >  fi
> > > done
> >
> > you don't need to call `grep` here, just use "pattern" option of g.mlist
> >
> > g.mlist rast pattern=*index*
>
> thanks - this worked:
>
> for x in "`g.mlist pattern='*.asc' sep= `" ; do ....

well I was too fast with this statement - it still does not work. 

When I do:

for rast in "`g.mlist pattern'*.asc' sep=" "`"; do
echo "$rast.test"; done

I get:

name1.asc name2.asc name3.asc.test

but I need:

name1.asc.test name2.asc.test name3.asc.test

any idea how to achieve that?

Martin


More information about the grass-user mailing list