[GRASSLIST:9976] Re: bash scripting
James Conolly
jamesconolly at trentu.ca
Tue Jan 24 16:25:39 EST 2006
I think I've answered my own question...
At the command line:
> nohup GRASS60 -text /grassdata/mylocation/PERMANENT < los.script &
Where los.script contains:
r.los input=dem.v1 output=los.1 coordinate=1234,1234 max_dist=10000
r.los input=dem.v1 output=los.1 coordinate=6789,6789 max_dist=10000
etc...
James
James Conolly wrote:
> Hello all,
>
> I need to run several hundred instances of r.los, and I'd like to do
> this in a bash script that calls and runs GRASS (so that I can prefix
> the script with a nohup command and logout and leave it running). If
> somebody with more knowledge of bash scripting could please provide me
> with some advice on how to best do this, I'd appreciate it very much. As
> is stands, if the following script:
>
> #!/bin/sh
> GRASS60 -text /grassdata/mylocation/PERMANENT
> r.los input=dem.v1 output=los.1 coordinate=1234,1234 max_dist=10000
> r.los input=dem.v1 output=los.1 coordinate=6789,6789 max_dist=10000
> end 0
>
> is run, GRASS60 opens, then sits there waiting for a command. Only if I
> then exit GRASS normally (i.e., exit), will it then move onto executing
> the r.los commands, but obviously as I'm no longer in the GRASS shell, I
> get a command not found. I understand all this, but my knowledge of bash
> scripting is too limited to work out how to get the script to move onto
> r.los to execute while in the GRASS shell...
>
> Any/all help appreciated,
>
> With thanks,
>
> James Conolly
> Trent University, Canada
>
More information about the grass-user
mailing list