[GRASSLIST:3496] Re: about writing a script program

Glynn Clements glynn.clements at virgin.net
Thu Apr 11 04:54:36 EDT 2002


marino vetuschi zuccolini wrote:

> I don't know if this is useful for you but i've some Grass command 
> nested in bash script procedure like that:
> 
> #!/bin/bash
> ...
> $GRASS_ETC/run $GRASS_BIN/g.remove rast=MASK
> $GRASS_ETC/run $GRASS_BIN/g.copy rast=mask_grid,MASK
> ...
> $GRASS_ETC/run $GRASS_BIN/g.region n=${bound_4} s=${bound_3} e=${bound_2} w=${bound_1} nsres=${nsres} ewres=${ewres}

Notes:

1. You don't need to use etc/run for running normal commands.

2. The GRASS "bin" directory will be prepended to the path when you
start GRASS, so you don't need to specify it explicitly.

So, it would be sufficient to write:

g.remove rast=MASK
g.copy rast=mask_grid,MASK
g.region n=${bound_4} s=${bound_3} e=${bound_2} w=${bound_1} nsres=${nsres} ewres=${ewres}

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list