[GRASS-SVN] r39687 - grass/branches/develbranch_6/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 7 23:38:25 EST 2009


Author: hamish
Date: 2009-11-07 23:38:24 -0500 (Sat, 07 Nov 2009)
New Revision: 39687

Modified:
   grass/branches/develbranch_6/lib/init/init.sh
Log:
replace pgrep with the more portable ps|grep.
see  http://www.opengroup.org/onlinepubs/000095399/utilities/ps.html


Modified: grass/branches/develbranch_6/lib/init/init.sh
===================================================================
--- grass/branches/develbranch_6/lib/init/init.sh	2009-11-06 22:01:34 UTC (rev 39686)
+++ grass/branches/develbranch_6/lib/init/init.sh	2009-11-08 04:38:24 UTC (rev 39687)
@@ -1020,10 +1020,8 @@
     d.mon stop="$MON"
 done
 
-# Attempt to close any open gis.m instances. 
-# Will work only on some systems, still has no harm to others
-# do Mac and MSys have pgrep? if [ -x `which pgrep` ] && [ `pgrep -c  ... ] ; then
-if [ -n "$TCLTKGRASSBASE" ] && [ `pgrep -c $GRASS_WISH` -ge 1 ] ; then
+# Attempt to close any open gis.m instances.
+if [ -n "$TCLTKGRASSBASE" ] && [ `ps -a | grep -c "$GRASS_WISH"` -ge 1 ] ; then
 	echo "Closing open gis.m sessions....."
 	echo 'foreach gwin [lsearch -all -inline [winfo interps] gm_tcl*] {
 		catch {send -async $gwin Gm::remoteExit $env(GIS_LOCK)}



More information about the grass-commit mailing list