[GRASS-user] scripts

Hi

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.

Can you guys help me with this? I tried to write a script and I got stucked, see below:

#!/bin/sh

#variable to customize:

path to GRASS software main directory

GISBASE=/usr/bin/grass64

path to GRASS database

GISDBASE=$HOME/grassdem

nothing to change below

#MAP=PERMANENT
#LOCATION=SRTMDEM

generate temporal LOCATION:

LOCATION=srtmdem
mkdir -p $GISDBASE/$LOCATION/PERMANENT

save existing $HOME/.grassrc6

if test -e $HOME/.grassrc6 ; then
mv $HOME/.grassrc6 /$HOME/grassdem/$LOCATION.grassrc6
fi

echo “LOCATION_NAME: $LOCATION” > $HOME/.grassrc6
echo “MAPSET:tmp” >> $HOME/.grassrc6
echo “DIGITIZER: none” >> $HOME/.grassrc6
echo “GISDBASE: $GISDBASE” >> $HOME/.grassrc6
export GISBASE=$GISBASE


Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650