[GRASSLIST:9975] bash scripting

James Conolly jamesconolly at trentu.ca
Tue Jan 24 15:55:43 EST 2006


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