[GRASS-user] Running Scripts in GRASS

William Kyngesburye woklist at kyngchaos.com
Tue Aug 18 16:54:44 EDT 2009


On Aug 18, 2009, at 3:18 PM, Andrew Lewin wrote:

> Hi Everyone,
>
> I am a beginner user of GRASS (I normally use ArcGIS) running on Mac  
> OS X Grass 6.4 ORC5.
>
> I am trying to process MODIS chlor-a images according to the MODIS  
> Wiki page.  There are many scripts on the wiki page that I would  
> like to use; however, I do not know how to:
> 1) save the script file, i.e. what file extension to I use?

use whatever filename the script has (or is specified).  No extension  
needed, but 'sh' is the standard shell script extension.  But it does  
need to be executable, which won't be true if you download the raw  
script text or copy-n-paste.  It should be set if the script is  
compressed.

In a Terminal, type this (drag-n-drop the script from a Finder window  
to the Terminal to paste the path to the script):

chmod +x /path/to/script

> 2) where to store the script, i.e. Do I store it in the mapset  
> location?

You can put it whereever you like, but in the GISBASE is probably not  
a good idea.  There is a GRASS environment setting to specify custom  
paths where to find GRASS addon executables: GRASS_ADDON_PATH.

Even easier, on OSX (for the application build), put it in:

~/Library/GRASS/6.4/Modules/bin

This is automatically added to GRASS_ADDON_PATH on startup.  It will  
be created the first time you run GRASS.

> 3) how to call the script, i.e. within the terminal shell (bash).
>
type the name of the script.

> Any help would be greatly appreciated.
>
> Andrew
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Oh, look, I seem to have fallen down a deep, dark hole.  Now what  
does that remind me of?  Ah, yes - life."

- Marvin




More information about the grass-user mailing list