[GRASS-user] batch export

Martin Wegmann martin.wegmann at uni-wuerzburg.de
Tue Aug 26 11:38:12 EDT 2008


On Dienstag, 26. August 2008 17:13:18 Martin Landa wrote:
> 2008/8/26 Martin Wegmann <wegmann at biozentrum.uni-wuerzburg.de>:
> >> > > 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?
>
> for rast in `g.mlist pattern='*.asc'`; do echo "${rast}.test"; done

great thanks - the 'pattern= ' to default solved it

Martin



-- 
**********************************************************************

University of Wuerzburg
Institute of Geography
Department of Remote Sensing
Remote Sensing and Biodiversity Unit
Am Hubland
97074 Wuerzburg, Germany
@
German Aerospace Center (DLR)
German Remote Sensing Data Center (DFD)

Phone:  +49-(0)931-888-4797
Fax:    +49-(0)931-888-4961
Email:  martin.wegmann at uni-wuerzburg.de

**********************************************************************


More information about the grass-user mailing list