Mail Archives: djgpp/1996/09/03/00:09:18
Thinking furiously, Omer Gabbay wrote:
>
> Hi,
> Does enybody know how I can redirect the 'stderr' of dos commands ?
> Thanks
> Omer
>
> e-mail: ogabbay AT israel DOT kla DOT com
>
Sure:
1: Use the redir.exe that comes with DJGPP
2: Use this trivial program:
#include <stdio.h>
main (int argc, char ** argv)
{
dup2 (fileno (stdout), fileno (stderr));
execvp (argv[1], argv + 1);
}
name it redir.c then compile it. Use it like this:
redir <your program> <arg1> <arg2> <...> <argn>
Fred
--
-------------------------------------------------------------------------------
.---- Fred Smith / Office: fred AT computrition DOT com
( /__ ,__. __ __ / __ : / 508-663-2524
/ / / /__) / / /__) .+' Home: fredex AT fcshome DOT stoneham DOT ma DOT us
/ / (__ (___ (__(_ (___ / :__ 617-438-5471
-------------------------------- Jude 1:24,25 ---------------------------------
- Raw text -