[GRASS-dev] BASH question about quitting GIS Manager

Hamish hamish_nospam at yahoo.com
Thu Nov 9 02:04:54 EST 2006

Michael Barton wrote:
> > also be careful to shut down the command line cleanly so .tmp/ gets
> > cleaned, etc.
> Doesn't simply typing "exit" at the GRASS prompt do that?

yes. also init.sh traps 2 3 15 (INT QUIT TERM). "kill $PID" defaults to
the TERM signal, so killing the grass Init.sh grass session should be
safe IF you know it's PID.

maybe set "export GRASS_PID=$$" in init.sh which the gui could kill?

> > ps - isn't the "&" in gis.m& redundant now?
> Not if you want to run anything from the GRASS prompt while the GIS
> Manager is running.

I've just tried it, it works.
the "&" is in the gui/tcltk/gis.m/gis.m shell script.

> Any idea how to do the loop I was thinking about?

my brain sugar is currently way too low to put too give it the thought
it deserves, but is there a way to get the PID of a child from the
parent when you launch it?

something like: (totally non-functional examples)

GRASS_GUI_PID=`exec gis.m`


gis.m &
GRASS_GUI_PID=$[?]   # but obviously not "$?" or "$$" ... ?

that might make shutting down gis.m when the main grass session exits
easier (add "kill $GRASS_GUI_PID" to init.sh's closedown code).


More information about the grass-dev mailing list