[GRASS-user] Running Scripts in GRASS

Markus Neteler neteler at osgeo.org
Tue Aug 18 20:30:43 EDT 2009


On Wed, Aug 19, 2009 at 2:16 AM, Andrew Lewin<andrew.lewin at sympatico.ca> wrote:
> Thanks for the help, but I am not quite clear on the part you say the script
> has to be an executable.

(indeed, it is not a requirement, see below)

> I copied and pasted the script from the wiki page
> and stored it in ~/Library/GRASS/6.4/Modules/bin; called the script by
> typing it (called chlatransl) to the Terminal shell.

That's fine.

> It said "chlatranl not found".

.. because typically the current directory is not in the path.
If the executable flag is on (set with chmod or a file manager)
then run it like this:

a) in the directory where the script is with
   ./chlatransl

or
b) with full path from anywhere
   /path/to/chlatransl

>  How do I compile the script to
> make it an executable.  Right now it is stored in a text file.

No need to compile (essentially, you cannot :)
If you want to even avoid the chmod/filemanager stuff, then
give it as parameter to "sh" which is the shell interpreter:

a) in the directory where the script is with
    sh chlatransl

or
b) with full path from anywhere
    sh /path/to/chlatransl

Perhaps we should cook up a Wiki page describing this briefly?

Hope this helps,
Markus


More information about the grass-user mailing list