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

Hamish hamish_b at yahoo.com
Sun Mar 2 01:57:55 EST 2008

> Hamish writes:
> > FWIW all known bashisms were removed prior to GRASS 6.2.2. 
> > Anything left needing bash explicitly uses #!/bin/bash

Ivan wrote:
> 	I. e., `i.spectral', `r.mapcalculator', `r.tileset' and
> 	`v.in.gps.babel'?  Could someone please point me to the list of
> 	the identified Shell portability issues of these scripts?

$ grep -rI 'bin/bash' scripts/* | cut -f1 -d: | grep -v '/.svn/'


variable arrays are bash specific:

I am not sure if this is ok or not:
   $( cat "$TMP1")

scripts/r.tileset/r.tileset:   heavy use of variable arrays

scripts/v.in.gpsbabel/v.in.gpsbabel: not sure
 maybe mentioned in the bashism threads in the archives?

ISTR that dash had an option to bulk test a script for bashisms.
 (see the archives)

I don't know if it is worth the effort to worry about making those sh
compatible. Even on Ubuntu where !/bin/sh isn't Bash, Bash is still
there from the terminal prompt and if you request it in the shebang.
And we've had no complaints from embedded users.
v.in.gpsbabel and r.tileset should both be rewritten in another
language anyway (python) so spending lots of effort on the current
versions of them would be energy better spent somewhere else IMO.

what's wrong with r.mapcalculator?

> 	As an alternative, it may be that GRASS could benefit from a
> 	Shell (et al)... implemented in Python.  It's all but an
> 	original idea.  E. g., Emacs implements Eshell [1], though it
> 	may be noted that because of Emacs Lisp Emacs dependency on the
> 	Shell is much looser than that of GRASS.
> 	Besides, such a Shell would have a much wider field of
> 	applicability than just being the interactive shell for GRASS.
> 	I guess, that may make such a project to attract some interest
> 	from the general Python community.

I don't think we should get into the business of trying to reimplement
a full shell. Interesting idea about putting some tasty bait out into
the wider Python developer community.

See also GRASS's tcltk gronsole capability* & QGIS's python shell menu

[*] try typing 'ls' and then click [Run], or 'xeyes' and then [Run
(bg)] in the lower panel of GIS.m's ouput window. I guess we could put
some text like "console:" above the lower frame.


Never miss a thing.  Make Yahoo your home page. 

More information about the grass-dev mailing list