[GRASS-dev] Re: 'g.gui wxpython' won't work in wingrass as wxgui is a shell script

Michael Barton michael.barton at asu.edu
Tue Mar 18 00:20:46 EDT 2008

On Mar 17, 2008, at 9:00 AM, grass-dev-request at lists.osgeo.org wrote:

>> Not really. Simple tasks can be done with just the GUI.
> 	One certainly won't go far only doing simple tasks.

Actually you can do some pretty complex stuff with the GUI. Try it.

>> More complex tasks really deserve a proper programming language.  The
>> range inbetween, where bash is a reasonable solution, is actually
>> quite narrow.
> 	The only thing that I have to say in the defense of Bash is that
> 	the little languages always have a narrow, but not a negligible
> 	niche.

The thing that bash allows you to do is to chain together the same  
commands that you get in the GUI. That is, you can do the same stuff  
in the GUI that you can do by scripting, but it might take you a LOT  
longer to accomplish it.

Any scripting language that can interact with GRASS commands (i.e.,   
most of them) can serve this same purpose. You can do it with Python,  
PERL, Java, TclTk, etc. Bash is handy because it comes preinstalled  
on Linux and Mac systems (and sh on earlier Unix systems) and was  
consistently available even when other scripting languages were not.  
It is only for this historical reason that it has become a standard  
for scripting in GRASS. IMHO, it's a pretty primitive and opaque  
programming language (e.g., you have to use another scripting  
language like awk to do floating point math). You can do a lot with  
it, but it is not easy to do or to deconstruct (or debug) what others  
have done. I say this in spite of having made a number of the  
existing GRASS Bash scripts, including some pretty complex ones  
(e.g., d.vect.thematic).

With GRASS 7 and opening up of GRASS for Windows, we have an  
opportunity to modernize scripting on GRASS (Note I am not a Windows  
user). There will always be people who script in Bash. It's great  
that one can do so. However, I think that it would benefit the  
community settle on a new scripting "standard" that is truly cross- 
platform and an easier, more up-to-date, powerful, and easier to use  
language. There are several good candidates for this, but Python has  
a number of pragmatic advantages in the current context.

What this means is that we need to have Python people volunteer to  
begin to rewrite existing Bash scripts in Python and begin writing  
any new scripts in that platform so that we can have the critical  
mass to encourage others to learn it and write in it. A couple people  
have started on this.


More information about the grass-dev mailing list