[GRASSweb-list] markus: web/faq batch-grass5.sh, NONE,
1.1 batch-grass6.sh, NONE, 1.1 index.html, 1.27,
1.28 batch-grass.sh, 1.1, NONE
grass at intevation.de
grass at intevation.de
Mon Aug 21 08:40:41 EDT 2006
Author: markus
Update of /grassrepository/web/faq
In directory doto:/tmp/cvs-serv17936
Modified Files:
index.html
Added Files:
batch-grass5.sh batch-grass6.sh
Removed Files:
batch-grass.sh
Log Message:
updates
--- NEW FILE: batch-grass5.sh ---
#!/bin/sh
#Author: Andrew E Long
# aelon at sph.umich.edu
# ael, Mon Nov 16 08:54:15 EST 1998
# update by A. Prasad 20. Jan. 2000
# aprasad/ne_de at fs.fed.us
# $Date: 2006/08/21 12:40:39 $
### Installation: Just edit paths for GISBASE, GISDBASE and GISRC
#customize this:
GISDBASE=/home/user/grassdata
GISBASE=/usr/local/grass5
GISRC=$GISDBASE/../.grassrc5
############ nothing to change below (I think)
if test $# -eq 0
then
cat <<EOF
batch-grass usage:
batch-grass runs a command (or executes all commands in a file) in the
grass environment. It simply sets some environmental variables and executes
the commands.
batch-grass location_name mapset command
batch-grass location_name mapset -file filename
e.g.,
batch-grass usgs PERMANENT -file make-quads
EOF
exit 0
fi
ETC=$GISBASE/etc
PATH=$GISBASE/bin:$GISBASE/scripts:$GISBASE/garden/bin:$PATH:/usr/bin
cat << EOF > $GISRC
GISDBASE: $GISDBASE
LOCATION_NAME: $1
MAPSET: $2
PAINTER: ppm
MAPLP: stuff.ppm
EOF
export GISBASE GISDBASE ETC PATH GISRC
export LOCATION_NAME=$1
export MAPSET=$2
export LOCATION=${GISDBASE?}/${LOCATION_NAME?}/${MAPSET?}
if test "$3" = "-file"
then
cat $4 | sh
else
# strip off the location and mapset,
shift 2
# then execute the command which remains:
$*
fi
/bin/rm -f $GISRC
exit 1
--- NEW FILE: batch-grass6.sh ---
#!/bin/sh
#Author: Andrew E Long
# aelon at sph.umich.edu
# ael, Mon Nov 16 08:54:15 EST 1998
# update by A. Prasad 20. Jan. 2000
# aprasad/ne_de at fs.fed.us
# update by R. Nuske 21. Aug. 2006
# rnuske at gwdg.de
# Customize this:
#------------------------------------------------------------------------------
GISBASE=/usr/local/grass-6.1.0 # path to GRASS binaries and libraries
GISDBASE=$HOME/luftbild/robert/grassdata # path to grassdata
# Nothing to change below (I think)
#==============================================================================
# Usage Message
#------------------------------------------------------------------------------
if test $# -eq 0
then
cat <<EOF
$0 usage:
batch-grass runs a command (or executes all commands in a file) in the
grass environment. It simply sets some environmental variables and executes
the commands.
$0 location_name mapset command
$0 location_name mapset -file filename
e.g.,
$0 usgs PERMANENT -file make-quads
EOF
exit 0
fi
# Some exports
#------------------------------------------------------------------------------
export GISDBASE
export GISRC=$HOME/.grassrc6_batch # path to GRASS settings file
export GIS_LOCK=$$ # use PID as lock file number
export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH
export LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH
# generate GRASS settings file:
#------------------------------------------------------------------------------
cat << EOF > $GISRC
GISDBASE: $GISDBASE
LOCATION_NAME: $1
MAPSET: $2
EOF
# batch-grass core
#------------------------------------------------------------------------------
if test "$3" = "-file"
then
cat $4 | sh
else
# strip off the location and mapset,
shift 2
# then execute the command which remains:
$*
fi
# Cleanup and Exit
#------------------------------------------------------------------------------
$GISBASE/etc/clean_temp # GRASS' cleanup routine
rm -rf /tmp/grass6-$USER-$GIS_LOCK # remove session tmp directory
rm -f $GISRC
exit 1
Index: index.html
===================================================================
RCS file: /grassrepository/web/faq/index.html,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- index.html 20 Aug 2006 20:10:34 -0000 1.27
+++ index.html 21 Aug 2006 12:40:39 -0000 1.28
@@ -136,9 +136,9 @@
<li> How to use GRASS in <b>batch mode</b> (fully script based)?:</li>
<ul>
- <li> GRASS 5: Download the script <a href="batch-grass.sh">batch-grass.sh</a> from
+ <li> GRASS 5: Download the script <a href="batch-grass5.sh">batch-grass5.sh</a> from
Andrew E. Long</li>
- <li> GRASS 6: See <a href="http://grass.gdf-hannover.de/wiki/GRASS_and_Shell">GRASS 6 and Shell</a> instructions</li>
+ <li> GRASS 6: Download the script <a href="batch-grass6.sh">batch-grass6.sh</a> from Robert Nuske. See also <a href="http://grass.gdf-hannover.de/wiki/GRASS_and_Shell">GRASS 6 and Shell</a> instructions</li>
</ul>
<h2>Is your question not answered yet? Check the GRASS Mailing list archives
--- batch-grass.sh DELETED ---
More information about the grass-web
mailing list