<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  I recently published a grass script for focussing surveys. The name is r.finder, hoping it can be of help for somebody... </blockquote><div><br>Augusto, great news :) I&#39;ll test it in my geomorphological work surely. You would not want to add it to GRASS-Addons wiki page (<a href="http://grass.osgeo.org/wiki/GRASS_AddOns">http://grass.osgeo.org/wiki/GRASS_AddOns</a>)?<br>
</div><div> <br>One note: in GRASS shell scripts it&#39;s usually better to use:<br><br>-- module &lt;g.message&gt; <span id="result_box" class="short_text" lang="en"><span class="hps">instead of </span></span>standard &quot;echo&quot;<br>
<br>-- special temp files (made with g.tempfile):<br><pre><div class="line" id="LC167"># create temporary file</div><div class="line" id="LC168">TMP1=&quot;$(g.tempfile pid=$$)&quot;</div><div class="line" id="LC169">if [ &quot;$?&quot; -ne 0 ] || [ -z &quot;$TMP1&quot; ] ; then</div>
<div class="line" id="LC170">    g.message -e &quot;ERROR: Unable to create temporary files.&quot;</div><div class="line" id="LC171">    exit 1</div><div class="line" id="LC172">fi</div></pre><br>-- cleanup function and some actions for the case of user exit<br>
<br><pre><div class="line" id="LC112">############################################################</div><div class="line" id="LC113">cleanup()</div><div class="line" id="LC114">{ </div><div class="line" id="LC115">    g.mremove -f vect=MY_TEMP_VECTOR --q</div>
<div class="line" id="LC116">    rm -f $TMP1*</div><div class="line" id="LC117">    </div><div class="line" id="LC118">}</div><div class="line" id="LC119">############################################################</div>
<div class="line" id="LC120">## what to do in case of user break:</div><div class="line" id="LC121">exitprocedure()</div><div class="line" id="LC122">{</div><div class="line" id="LC123">    echo &quot;User break!&quot;</div>
<div class="line" id="LC124">    cleanup</div><div class="line" id="LC125">    exit 1</div><div class="line" id="LC126">}</div><div class="line" id="LC127"><br></div><div class="line" id="LC128">## shell check for user break (signal list: trap -l)</div>
<div class="line" id="LC129">trap &quot;exitprocedure&quot; 2 3 15</div></pre><br>---------------------------------------------------------------------------------------<br>   <br><br></div></div>