Create GRASS database by script

Agustin Lobo alobo at ija.csic.es
Fri May 28 12:49:37 EDT 1999


Markus,

You can use ECHO $var > file.name

to create the files (i.e., DEFAULT_WIN)
where $var contains text that you pass to the script in
the command line. For the first line you use > and
for the rest >> to append.
You can also create the directories with mkdir.
For example (this is not tested):

#!/bin/csh
#set echo
#set verbose 
(uncomment for testing)
set nameLOC = $argv[1]
set nameMAPS = $argv[2]
set defWIN.proj = $argv[3]
etc
mkdir $nameLOC
cd $nameLOC
mkdir PERMANENT
cd PERMANENT
echo "proj: " $defWIN.proj > DEFAULT_WIN
echo "zone: " $defWIN.zone >> DEFAULT_WIN

and so on.

Agus


****NOTE NEW PHONE NUMBER*****
Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es
http://pangea.ija.csic.es/alobo


On Fri, 28 May 1999, Markus Neteler wrote:

> Hi all,
> 
> I would like to create a new GRASS databse
> (with location definition etc.) by script.
> 
> Is there a way to do that?
> 
> 
> Thank you
> 
>   Markus Neteler
> 
> -----------------------------------------------------------------
>  Geographisches Institut   |     Schneiderberg 50
>   + Physische Geographie         30167 Hannover, Germany
>   & Landschaftsoekologie +       Tel: ++49-(0)511-762-4494 /-3924
>  Universitaet Hannover           Fax: ++49-(0)511-762-3984
>                 neteler at geog.uni-hannover.de
>         http://www.geog.uni-hannover.de/users/neteler/
> -----------------------------------------------------------------
> 



More information about the grass-user mailing list