Hi<br><br>I'm not familiar with bash scripting, I want to write a script that starts GRASS and create a new LOCATION and a MAPSET, specify the coordinate system for my database, specify a geodetic datum for the LOCATION, import datasets into the GRASS, do watershed analysis on the DEM data set, convert DEM raster into vector, and then calculate univariate statistics from a GRASS raster map. <br>
<br>Can you guys help me with this? I tried to write a script and I got stucked, see below:<br><br>#!/bin/sh<br><br>#variable to customize:<br># path to GRASS software main directory<br>GISBASE=/usr/bin/grass64<br># path to GRASS database<br>
GISDBASE=$HOME/grassdem <br><br># nothing to change below<br>#MAP=PERMANENT<br>#LOCATION=SRTMDEM<br><br><br># generate temporal LOCATION:<br>LOCATION=srtmdem<br>mkdir -p $GISDBASE/$LOCATION/PERMANENT<br><br># save existing $HOME/.grassrc6<br>
if test -e $HOME/.grassrc6 ; then<br>mv $HOME/.grassrc6 /$HOME/grassdem/$LOCATION.grassrc6<br>fi<br><br>echo "LOCATION_NAME: $LOCATION" > $HOME/.grassrc6<br>echo "MAPSET:tmp" >> $HOME/.grassrc6<br>
echo "DIGITIZER: none" >> $HOME/.grassrc6<br>echo "GISDBASE: $GISDBASE" >> $HOME/.grassrc6<br>export GISBASE=$GISBASE<br><br><br><br><br clear="all"><br>-- <br>Kind Regards<br>TS Gumede<br>
CSIR, Meraka Institute<br>072 258 1650<br><br>