Dear All,<div><br></div><div>I built the short code below and if I run if I run it under "bash" I can </div><div>generate a list of command that after I can copy and past, and </div><div>run under the same "bash" session. If I try remove the "echo" </div>
<div>I get errors. As the list of HEXID is so long (about 3.000) </div><div>I need to run the code below in parts, and do a lot of copy-and-past</div><div>to reach up the desidere result. </div><div><br></div><div>My question is if I can generate and text file to run all HEXIDs on one</div>
<div>session. I tryed change "echo.." by "cat ... > c:/grass/scripts/myscript.txt"</div><div>but the file get some stranger simbols and I am not sure if </div><div>grass will understand it.</div><div>
<br></div><div>I run native wingrass 6.3.0, not under MSYS or linux.</div><div><br></div><div>Thanks for your time</div><div><br></div><div>Miltinho-Brazil</div><div><br></div><div>----</div><div><div><br></div><div><font face="Arial" size="2"></font><div>
for HX in `v.db.select map=hex001000ha_clip column=HEXID where="HEXID<=100"`; do</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>echo v.extract --o input=hex001000ha_clip output=vec_hex_temp where="\"`echo HEXID=$HX`"\"</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>echo g.region vect=vec_hex_temp res=2.5</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>echo v.to.rast input=vec_hex_temp output=rast_hex_temp use=cat</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>echo r.mapcalc "\"rast_hex_temp_1=if(rast_hex_temp>0,1,null())"\"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>echo r.mapcalc "\"rast_hex_temp_1_uso=Floresta_Vale1Vale2_2pt5m_MATA_fundo3*rast_hex_temp_1"\"</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>echo r.stats -a input=rast_hex_temp_1_uso output=D:/Usuarios/qtdhex1000_hexid`echo $HX`.txt</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>echo g.remove -f vect=vec_hex_temp</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>echo g.remove -f rast=rast_hex_temp,rast_hex_temp_1,rast_hex_temp_1_uso</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>echo g.region -d</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>echo #</div><div>done</div><div><br></div></div></div>