Dear All,<div><br></div><div>I built the short code below and if I run if I run it under &quot;bash&quot; I can&nbsp;</div><div>generate a list of command that after I can copy and past, and&nbsp;</div><div>run under the same &quot;bash&quot; session. If I try remove the &quot;echo&quot;&nbsp;</div>
<div>I get errors. As the list of HEXID is so long (about 3.000)&nbsp;</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.&nbsp;</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 &quot;echo..&quot; by &quot;cat ... &gt; c:/grass/scripts/myscript.txt&quot;</div><div>but the file get some stranger simbols and I am not sure if&nbsp;</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=&quot;HEXID&lt;=100&quot;`; 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=&quot;\&quot;`echo HEXID=$HX`&quot;\&quot;</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 &quot;\&quot;rast_hex_temp_1=if(rast_hex_temp&gt;0,1,null())&quot;\&quot;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>echo r.mapcalc &quot;\&quot;rast_hex_temp_1_uso=Floresta_Vale1Vale2_2pt5m_MATA_fundo3*rast_hex_temp_1&quot;\&quot;</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>