[GRASSLIST:2089] Re: GRASS and r.reclass in a batch
javier garcia - CEBAS
rn001 at cebas.csic.es
Thu Dec 18 04:12:51 EST 2003
Hi Hamish,
thanks a lot for the attached.
Is it possible that the script has an error?
I've run it and I receive a lot of messages like:
./reclass_scrip.sh: : command not found
./reclass_scrip.sh: : command not found
./reclass_scrip.sh: : command not found
Best regards,
Javier
-----------------------------------------------------------------------
The problem is to pass values of reclassification rules
> > to r.reclass. I've tried:
>
> [...]
>
> > But this doesn't work. I think that this could be also with a bash
> > script, but I don't know anything about bash.
>
> It is actually pretty clean with Bash, try the attached.
>
>
> regards,
> Hamish
>
>
--------------------------------------
#!/bin/bash
# reclass script
i=1
while [ $i -le 25 ] ; do
r.reclass input=imagen$i output=imarec$i << EOF
253 = 192
252 = 96
251 = 48
250 = 24
249 = 12
221 = 8
193 = 7
165 = 6
133 = 4
102 = 3
70 = 2
39 = 1
* = NULL
end
EOF
i=`expr $i + 1`
done
-------------------------------------
More information about the grass-user
mailing list