<HTML>
<HEAD>
<TITLE>BASH question about quitting GIS Manager</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Repeatedly there have been requests to make it possible to quit GRASS when quitting the GIS Manager (and to automatically quit the GIS Manager when quitting GRASS). <BR>
<BR>
I had an idea that I thought I run by everyone and see if I could get some suggestions about getting it to work.<BR>
<BR>
1. When the GIS Manager shell script is first run (gis.m&amp; to run in background), have it set an environmental variable. For example...<BR>
export GRASS_GUI_RUN=&#8221;TRUE&#8221;<BR>
<BR>
2. The script would idle away, waiting for any change to the environmental variable (this is a part I&#8217;m not sure how to do)...<BR>
while GRASS_GUI_RUN==&#8221;TRUE&#8221;<BR>
... let the GIS Manager run<BR>
<BR>
3. When the GIS Manager quits (or quits with an option to exit GRASS), it could set this variable to false<BR>
set env(GRASS_GUI_RUN) &#8220;FALSE&#8221;<BR>
<BR>
4. The script would exit its while loop and echo &#8220;exit&#8221; to the GRASS command prompt, &#8220;shutting down&#8221; GRASS (i.e., resetting the GRASS environment and closing the GRASS shell).<BR>
<BR>
Would something like this work???<BR>
<BR>
If so, we also might be able to use this for automatically quitting the GIS Manager. <BR>
-Write into the GRASS exit routine a check for the GRASS_GUI_RUN environmental variable<BR>
-If it is set to TRUE, kill WISH.<BR>
<BR>
What do you think?<BR>
<BR>
Michael<BR>
__________________________________________<BR>
Michael Barton, Professor of Anthropology<BR>
School of Human Evolution &amp; Social Change &nbsp;&nbsp;&nbsp;<BR>
Center for Social Dynamics and Complexity<BR>
Arizona State University<BR>
<BR>
phone: 480-965-6213<BR>
fax: 480-965-7671<BR>
www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a> <BR>
</SPAN></FONT>
</BODY>
</HTML>