### GRASS GIS Tips and Tricks

[more to be added]

- Error messages: To avoid sending error messages by email, generate an empty file called GIS_ERROR_LOG in your home directory:
cd $HOME
touch GIS_ERROR_LOG
Then set the environment variable GRASS_STDERR to 1 (or any other value), now errors will be printed into $HOME/GIS_ERROR_LOG:
export GRASS_STDERR=1
or, depending on your shell
setenv GRASS_STDERR 1
- Save GRASS commands: To store the commands of a GRASS session, use the UN*X command "script".
- To get personal BASH shell definitions (aliases, color listing option, ...) into GRASS, store them in `$HOME/.grass.bashrc`
- To get personal CSH shell definitions (aliases, color listing option, ...) into GRASS, store them in `$HOME/.grass.cshrc`
- Monitor and print-to-file driver information
- GRASS 5 Environment variables
- Piping commands to a GRASS module:
  For usage in a script (will generate two maps):

r.mapcalc << EOF
foo = 3.14159
baz = sqrt(foo)
EOF

For usage from a text file:

cat > /tmp/textfile.asc <<EOF
foo = 3.14159
baz = sqrt(foo)
EOF

r.mapcalc < /tmp/textfile.asc

- Q: Is is possible to switch one LOCATION to another while running GRASS?

      A: Partially. With pre4 and later, using any of:

              g.gisenv set=GISDBASE=newdbase
              g.gisenv set=LOCATION_NAME=newlocation
              g.gisenv set=MAPSET=newmapset

      will mostly work.

      Things which won't work correctly include:

      1. Monitor state (resizing, d.save, d.redraw etc). You may as well run
      "d.erase" when changing location, as the stored state is no longer
      usable.

      2. Existing NVIZ and tcltkgrass sessions won't recognise the change of
      location; they will continue to use the old location.

      3. The shell history (.bash_history) will be saved in the original
      mapset directory.

- Q: Is is possible to run parallel GRASS sessions on one machine?

  A: Yes, but only if you create your own startup script (see above "switch LOCATION" example) and when each job runs in an own mapset.

- Data Import into GRASS (various formats)
- Data Export from GRASS (various formats)

### Other Commands

help home, database, display, drivers, general, grid3d, imagery, import, misc, models, paint, photo, postscript, raster, scripts, sites, vector