Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question

migrated from Sep 21 '12 at 16:29

This question came from our site for professional and enthusiast programmers.

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.