[GRASSLIST:4754] RE: batch jobs

Daren Zywicki daren.zywicki at gtri.gatech.edu
Wed Oct 16 17:10:22 EDT 2002


Martin,

There are two ways I know of to do this in a script file.  I would 
recommend doing a search on the web for bash programming to get more 
information about bash script loops:

Disclaimer:
This code is provided "AS IS" without warranty of any kind, either 
expressed or implied, including, but not limited to, the implied warranties 
of merchantability and fitness for a particular purpose.  The ENTIRE risk 
as to the quality and performance of the code is with you.  Should the code 
prove defective, you assume the cost of all necessary servicing, repair or 
correction.


1.) Use a listing of files in a particular directory in a for loop (bash 
syntax shown for *.txt files):

for f in <path to files>/*.txt; do

     echo ${f}
     ... commands for file ${f}

done

2.) Use an input file in a while loop with the piping capabilities of unix 
(as shown below in bash syntax):

while read list1; do

    ... commands for ${f}

done < path to file containing list of maps to process/map_list.txt

where list1 refers to the current input file listed in the map_lists.txt file.


You'll probably have to play around to get things to work, but I hope this 
helps.


Daren



>----- Original Message -----
>From: Martin Wegmann <m.wegmann at web.de>
>To: GRASSLIST (eng.) <GRASSLIST at baylor.edu>
>Sent: Wednesday, October 16, 2002 3:57 AM
>Subject: [GRASSLIST:4750] batch jobs
>
>
> > hello,
> >
> > I have a couple of commands which I have to run on each image. Would it be
>possible to merge these commands and only change the input and output each
>time for each image?
> >
> > like input=map1 output=map1a
> >
> > command x  in=map1 out=x
> > command y  in=x out=y
> > and so on until the final out=map1a
> >
> >
> > as far as I understood the use of shell scripts, they are desigend to do
>this. But how do I write them and load them into GRASS?
> >
> > thanks for your help,
> > Martin
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > -------------------------------
> >
> > Martin Wegmann
> > Tropical Ecosystem Research Center
> > PMB 44 Winnellie / Darwin
> > NT 0821
> > Australia
> >
> > .......
> >
> > priv.
> > 4 Carpentier Cres.
> > Wagaman / Darwin
> > NT 0810
> > Autralia
> > 0061 8 8927 1241
> >

____________________________________________________
Daren J. Zywicki, PhD
Georgia Tech Research Institute
Sensors and Electromagnetic Applications Lab (SEAL)
____________________________________________________



More information about the grass-user mailing list