[GRASS-dev] Merging stdout and stderr

Paul Kelly paul-grass at stjohnspoint.co.uk
Mon Nov 20 08:34:40 EST 2006



On Thu, 16 Nov 2006, Hamish wrote:

> Glynn Clements wrote:
>>> 2. Might it be a worthwhile idea to include a simple program with GRASS
>>> that did this (copies everything from stdin to stdout) so we can be sure
>>> what's going on?
>>
>> 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).
>
> see also:
>  lib/init/echo.c -> $GISBASE/etc/echo
>
> funny that that outputs to stderr..

Yes! This would be useful on Windows if it didn't write to stderr, as the 
Windows echo behaves differently to the Unix one. The comments in the 
header in the source say it writes to stdout but the earliest CVS version 
from 1999 writes to stderr. I wonder could we change it. I wonder does 
anything use it and/or need the stderr functionality...




More information about the grass-dev mailing list