I am in a GRASS database (in command shell), where I want to run a loop function. For example, I want to do an operation on many raster files that are in the database. I know this must be done through a txt file. What i am confused about is where I should put this file, and how exactly I should call it.

I am also a bit confused if I should be writing a batch or a bash file. GRASS is UNIX based which makes me think I should be looking to bash, but I am in windows command shell, where batch scripting applies.

Thanks for your help!


A bash file (.sh) will work fine, the name and location are not really important. If you are using the graphical interface of GRASS, you can copy/paste your bash script in the scripting window and run it from there. See also this tutorial.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy