[GRASS-dev] Merging stdout and stderr
paul-grass at stjohnspoint.co.uk
Tue Nov 14 12:14:35 EST 2006
On Tue, 14 Nov 2006, Glynn Clements wrote:
> I suggest the latter, i.e. write our own mini-"cat" program. It will
> need to explicitly put stdin/stdout into line-buffered mode (pipes are
> block-buffered by default).
I've done something like this - I called it grocat as it's for gronsole
and like cat. All seems to work (unfortunately I can only test gis.m on
Windows at the minute) so I've committed some more changes to CVS. This
includes the earlier changes to create a .bat file for every script on
Windows. The batch files are run from Tcl/Tk and if GRASS is run from
cmd.exe; the actual scripts are run if GRASS is run from the Msys shell.
Just as a reminder, the batch files invoke the program specified by the
GRASS_SH environment variable and append a -c switch and the full path to
the script with c:/grass/dist... syntax, followed by any arguments. I'd
hope it would work with other shells than Msys too.
Because it is needed even when GRASS is started from the Msys shell (when
running gis.m, Tcl needs a .exe, .bat or .com file) I have added
GRASS_SH=/bin/sh to Init.sh.
More information about the grass-dev