[GRASS-windows] msys grass63 and wingrass

Glynn Clements glynn at gclements.plus.com
Sat Feb 9 15:41:05 EST 2008


Gerald Nelson wrote:

> I have had good luck starting wingrass from within an msys terminal and
> using it to run scripts that were originally developed in a linux
> environment. The reason this is helpful is that the scripting features make
> grass really powerful and as far as I know scripts really only work in msys.

Bourne shell scripts require MSys (or some other Bourne shell), but
you don't need to start GRASS from MSys.

The main issue with scripts is that Windows doesn't understand the
"#!" notation used to specify the interpreter.

All of the supplied scripts in $GISBASE/scripts have a corresponding
.bat file in $GISBASE/bin which invokes script via %GRASS_SH%. This
allows you to run those scripts from the Windows command prompt.

If you write scripts of your own, you need to either add a
corresponding .bat file, or give the script a .sh extension and
associate that with the shell, e.g. via the ftype and assoc commands. 
You can use the PATHEXT variable to eliminate the need to type the
extension.

> Now if the move to doing scripting in python takes hold, I guess that would
> remove the need for msys, although it would also mean that a huge number of
> shell scripts would have to be rewritten.

It would require the scripts to be re-written. However, there are only
75 of them, and most of them are quite straightforward. Someone who is
reasonably familiar with Python (and, specifically, with the
subprocess module), could probably convert most of them in a day.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-windows mailing list