Thanks, The only problem I have now when I'm running the script, it gives me an error saying LOCATION_NAME not set. See below:<br><br>#!/bin/sh<br><br>#variable to customize:<br># path to GRASS software main directory<br>
export GISBASE=/usr/lib/grass64<br># path to GRASS database<br>GISDBASE=$HOME/grassdata <br><br># nothing to change below<br>MAP=$1<br>LOCATION=$2<br><br><br># generate temporal LOCATION:<br>TEMPDIR=tmp<br>mkdir -p $GISDBASE/$TEMPDIR/temp<br>
<br># save existing $HOME/.grassrc6<br>if test -e $HOME/.grassrc6 ; then<br>mv $HOME/.grassrc6 /$GISDBASE/$TEMPDIR.grassrc6<br>fi<br><br> echo "LOCATION_NAME: $TEMPDIR" > $HOME/.grassrc6<br> echo "MAPSET:tmp" >> $HOME/.grassrc6<br>
echo "DIGITIZER: none" >> $HOME/.grassrc6<br> echo "GISDBASE: $GISDBASE" >> $HOME/.grassrc6<br> <br><br><br># path to GRASS settings file:<br>export GISRC=$TEMPDIR/.grassrc6<br><br># first our GRASS, then the rest<br>
export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH<br><br># first have our private libraries:<br>export LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH<br>export GRASS_LD_LIBRARY_PATH=$LD_LIBRARY_PATH<br><br># settings for graphical output<br>
PNGOUTPUTDIR=$TEMPDIR<br># current date<br>DATE=`LC_ALL=C date -R | tr -s ' ' ' ' | cut -d' ' -f2,3,4 | tr -s ' ' '_'`<br>export GRASS_PNGFILE=$PNGOUTPUTDIR/grass6_recent_floods_${DATE}.png<br>
export GRASS_TRUECOLOR=TRUE<br>export GRASS_WIDTH=900<br>export GRASS_PNG_COMPRESSION=1<br><br># use process ID (PID) as lock file number:<br>export GIS_LOCK=$$<br><br>##### the algorithms goes here<br><br>error_routine () {<br>
echo "ERROR: $1"<br> exit 1<br>}<br><br><br># import DEM data set.<br>cd /home/tgumede1/grassdata <br>r.in.gdal input=TRMMLast1day.tif output=rainfall<br># set region to default settings<br>g.region rast=rainfall<br>
<br># import DEM data set.<br>r.in.gdal input=Dem_CF.tif output=dem<br># set region to default settings<br>g.region rast=dem<br><br><br><br><br><br><div class="gmail_quote">On Thu, Jun 24, 2010 at 10:55 AM, Paul Kelly <span dir="ltr"><<a href="mailto:paul-grass@stjohnspoint.co.uk">paul-grass@stjohnspoint.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">Sandile Gumede wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I'm using ubuntu, I installed grass from the synaptic. So the script to<br>
start grass is in /usr/bin then the file name is grass64<br>
(/usr/bin/grass64) and the scripts are in /usr/lib/grass64 then inside<br>
grass64 folder you get other folder like scripts and so on. That is why<br>
in my script I wrote:<br>
</blockquote>
<br></div>
Then your GISBASE should be /usr/lib/grass64<br>
<br>
The location of /usr/bin/grass64 is irrelevant - it is only a startup script to set appropriate environment variables, etc. You are doing all this in your script so you don't need to use the grass64 script at all (and GRASS doesn't need it for anything else).<br>
<br>
Hopefully that makes it clearer?<br><font color="#888888">
<br>
Paul<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Kind Regards<br>TS Gumede<br>CSIR, Meraka Institute<br>072 258 1650<br><br>