[GRASS5] Need help debugging problem with thematic mapping script

Glynn Clements glynn at gclements.plus.com
Fri Nov 18 07:27:54 EST 2005


Michael Barton wrote:

> If I add >/dev/null or >@stdout to the grass commands (d.mon only?) inside
> d.vect.thematic will this do the trick?

Yes. You only need to do it when running a command which creates
long-lived children (e.g. "d.mon start=..."), but you can do it
whenever you don't require the command's output.

> Any reason to choose one over the other?

Using >/dev/null will discard the output, while >@stdout will let it
go to where d.vect.thematic's stdout goes (e.g. the terminal from
which d.vect.thematic was run).

> The run_panel procedure in d.m.tcl traps stdout at the level of the tcl open
> command, at least. Will this carry through to the output from commands
> inside the script if I use >@stdout?

If you use ">@stdout 2>@stderr", then no redirection will occur, i.e. 
the command will inherit its stdout and stderr. If you don't redirect
them at all, they get redirected to Tcl itself; stdout is captured and
returned as the result of exec (as a string) or open (as a file
handle), while stderr is monitored and an error generated if anything
is written to it.

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




More information about the grass-dev mailing list