User Tools

Site Tools


wiki:grassvariables

Insert these lines in your bash script allowing to run your script by bash name_script.sh. Of course set the settled directories in accordance to your directories.

echo "LOCATION_NAME: europe"                     >  $HOME/.grassrc6
echo "MAPSET: PERMANENT"                         >> $HOME/.grassrc6
echo "DIGITIZER: none"                           >> $HOME/.grassrc6
echo "GRASS_GUI: text"                           >> $HOME/.grassrc6
echo "GISDBASE: /home/user/ost4sem/grassdb"               >> $HOME/.grassrc6

path to GRASS binaries and libraries:

export GISBASE=/usr/lib/grass64
export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts
export LD_LIBRARY_PATH="$GISBASE/lib"
export GISRC=~/.grassrc6

use process ID (PID) as lock file number:

export GIS_LOCK=$$

settings for graphical output to PNG file (optional)

export GRASS_PNGFILE=/tmp/grass6output.png
export GRASS_TRUECOLOR=TRUE
export GRASS_WIDTH=900
export GRASS_HEIGHT=1200
export GRASS_PNG_COMPRESSION=1

test if your script is able to use grass command by asking the g.gisenv

g.gisenv
wiki/grassvariables.txt · Last modified: 2017/12/05 22:53 (external edit)