http://grass.itc.it/pipermail/grass-commit/2005-February/016727.html+if +[ -n "$GISBASE" ] ; then + echo "GRASS is already running in this shell! Exiting." + exit 1 +fi I am not sure if GISBASE is the best for test, it is necessary for QGIS, (OGR) and it can cause confusion. $GIS_LOCK is probably better. Radim