[GRASS-dev] File based GRASS batch processing?

Markus Neteler neteler at itc.it
Tue Jan 23 09:54:51 EST 2007


Markus Neteler wrote on 01/23/2007 12:13 AM:
> On Tue, Jan 23, 2007 at 12:10:20AM +0100, Markus Neteler wrote:
>   
>> Attached a first sort of working hack "diff". Could be
>> certainly nicer.
>>     
>
> Sorry, this one I wanted to send.
>   
I have submitted an improved version to CVS.

Usage:
Just define the environmental variable GRASS_BATCH_JOB with
the shell script file containing GRASS (or whatever) commands, preferably
with full patch. Then launch GRASS and it will be executed. Best is
to launch GRASS in -text mode and to provide GISDBASE/location/mapset
as parameters. The job scripts needs executable file permissions (chmod).

Example:

chmod u+x $HOME/my_grassjob.sh
export GRASS_BATCH_JOB=$HOME/my_grassjob.sh
grass63 ~/grassdata/spearfish60/neteler/

The grass63 command starts GRASS, executes the contents of the job file
and leaves GRASS. Since the normal startup/closure is used, all tmp files
are properly removed.

To deactivate the batch job mode, run (bash example):
unset GRASS_BATCH_JOB

Markus

PS: Next I learn "screen" :-)




More information about the grass-dev mailing list