home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
c_news
/
09
/
rse.c
< prev
Wrap
C/C++ Source or Header
|
1988-07-16
|
682b
|
30 lines
/* RSE.C -- a program to redirect standard error
*
* Written by Scott R. Houck
*
* This program will redirect standard error to standard output
so
* that a program's standard error output can be sent to a file
* using the redirection symbols '>' or '>>' on the command line.
*
* The syntax is: RSE program [arguments]
*/
#include <stdio.h>
#include <io.h>
#include <process.h>
int main(argc, argv)
int argc;
char **argv;
{
if (argv < 2)
{
fprintf(stderr, "Usage: RSE program [arguments]\n");
exit(1);
}
++argv;
dup2(fileno(stdout), fileno(stderr));
return spawnvp(P_WAIT, *argv, argv);
}