GRASS and Shell

From GRASS-Wiki
Revision as of 11:41, 24 June 2006 by Neteler (talk | contribs) (made an own page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You have to set a couple of variables:

  # Example in bash shell syntax:
  export GISBASE=/usr/local/grass60
  export PATH=$PATH:$GISBASE/bin:$GISBASE/scripts
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib
  export GISRC=$HOME/.grassrc6
  export GRASS_PNGFILE=/tmp/grass6output.png
  export GRASS_TRUECOLOR=TRUE
  export GRASS_WIDTH=900
  export GRASS_PNG_COMPRESSION=1
  export GIS_LOCK=$$

  #test:
  g.version

  #this should print the GRASS version used.

Then you can launch other GRASS commands. This works within Shell scripts and also in the command line terminal.