[GRASS-user] split adjacent categories

Martin Wegmann wegmann at biozentrum.uni-wuerzburg.de
Thu Jan 10 14:12:21 EST 2008


On Donnerstag, 10. Januar 2008 20:00:16 Patton, Eric wrote:
> >while [  $COUNTER < $max ]; do
> >        echo The counter is $COUNTER
> >
> >	r.mapcalc "t1 = if(rast_in == $COUNTER,1,null())"
> >	r.buffer input=t1 output=b.$COUNTER distance=500
> >
> >	let COUNTER=COUNTER+1
> >
> >   done
> >
> >but failed because COUNTER was not recognized and I don't know at all, if
> >these bash statements work at all using GRASS.
> >
> >I welcome any other idea.
>
> Shouldn't your bash variables be quoted within the loop?
>
> while [ "$COUNTER" -lt "$MAX" ] ; do
>
> Similarly for the let statement:
>
> let "COUNTER=COUNTER+1"

thanks - I added it but the first part:

COUNTER = 1

already caused 

COUNTER: command not found

can this bash scripting be used in GRASS like that at all?

Martin



More information about the grass-user mailing list