[GRASS-user] Re: r.finder

Alexander Muriy amuriy at gmail.com
Fri May 11 13:37:29 EDT 2012


>   I recently published a grass script for focussing surveys. The name is
> r.finder, hoping it can be of help for somebody...


Augusto, great news :) I'll test it in my geomorphological work surely. You
would not want to add it to GRASS-Addons wiki page (
http://grass.osgeo.org/wiki/GRASS_AddOns)?

One note: in GRASS shell scripts it's usually better to use:

-- module <g.message> instead of standard "echo"

-- special temp files (made with g.tempfile):

# create temporary file
TMP1="$(g.tempfile pid=$$)"
if [ "$?" -ne 0 ] || [ -z "$TMP1" ] ; then
    g.message -e "ERROR: Unable to create temporary files."
    exit 1
fi


-- cleanup function and some actions for the case of user exit

############################################################
cleanup()
{
    g.mremove -f vect=MY_TEMP_VECTOR --q
    rm -f $TMP1*

}
############################################################
## what to do in case of user break:
exitprocedure()
{
    echo "User break!"
    cleanup
    exit 1
}

## shell check for user break (signal list: trap -l)
trap "exitprocedure" 2 3 15


---------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20120511/5aeb427d/attachment.html


More information about the grass-user mailing list