[GRASSLIST:9651] Re: automated start&exit grass via shell script

Wolf Bergenheim wolf+grass at bergenheim.net
Tue Dec 27 15:10:31 EST 2005


Hi,

The way I do it is like this:
cd into the grass database directory (setting the env variables listed
in the grass man page doesn't work for me for some reason). Then I
launch grass like this:
grass61 < /path/to/script > /path/to/output

The reason for redirecting the output to a separate file is that grass
clears the screen on exit. The script has exit as the last command.

an example script could be:
g.list rast
exit

If you want to be fancy you could redirect each command to a separate
file or echo the command before executing it. I tried using bash, and it
didn't work, but my default shell is tcsh, for which this works nicely.

--Wolf

On 20/12/05 01:17, Luigi Ponti wrote:
> I might have posted this already - maybe it is too obvious, that would
> explain why I did not get an answer:
> 
> Is there a way to automate the following steps via a shell script (or
> anything else)?
> 
> - start GRASS;
> - execute a script or command;
> - exit GRASS.
> 
> Thanks,
> 
> Luigi
> 

-- 

<:3 )---- Wolf Bergenheim ----( 8:>




More information about the grass-user mailing list