[GRASS-user] batch export

Martin Landa landa.martin at gmail.com
Tue Aug 26 11:13:18 EDT 2008


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

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *


More information about the grass-user mailing list