[GRASS-dev] Shell scripts

Glynn Clements glynn at gclements.plus.com
Thu Nov 26 00:27:11 EST 2009

Hamish wrote:

> Glynn wrote:
> > bin/nviz
> it's really just a one line wrapper around:
> exec "$GISBASE/etc/nviz2.2/nviz" -f "$GISBASE/etc/nviz2.2/scripts/nviz2.2_script" ${1+"$@"}
> which doesn't need to be a shell script.
> this doesn't currently work for WinGrass + wxGUI* in 6.4/5, so a great
> candidate for replacement.

On Windows, visualization/nviz/scripts/nviz.bat should be installed in
$GISBASE/bin, containing:

@"%GISBASE%\etc\nviz2.2\nviz.exe" -f "%GISBASE%\etc\nviz2.2\scripts\nviz2.2_script" %*

This should work, so long as the command is invoked with shell=True
(if shell=False, only .exe files can be executed). The grass.script
module defines versions of Popen() and call() which will do this
automatically for win32.

> > The remaining question is whether d.path.sh ... scripts should
> > be converted to Python or removed. I don't think that d.path.sh
> > works with the GUI.
> it was written specifically as a component of the tcltk GUI and AFAIK
> works with that. d.path should probably be written into the python
> GUI as its own tool-button, which would make d.path.sh redundant in
> GRASS 7.

Unless it works with the wxPython GUI, it's already redundant, as
gis.m doesn't exist in 7.0.

The script simply calls d.vect followed by d.path. None of the
display-related environment variables are changed within the script,
so it won't work with direct rendering unless GRASS_PNG_READ=TRUE
(and, AFAIK, neither GUI does this).

Yep; gmmenu.tcl has:

{command {[G_msg "Display shortest route"]} {} "d.path: Display shortest route along network between 2 nodes (visualization only)" {} -command {
	spawn d.path.sh -b --ui

So it won't work in 7.0 (note that 7.0's d.path doesn't support
selecting vectors with the mouse).

Removed in r39802.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list