kneller@socrates.ucsf.edu (Don Kneller%Langridge) (05/27/87)
Nothing like writing a 2-line program and getting 1 line wrong. Here
is RSE.C again (Microsoft C v4.0 source). The execvp line had &av[2].
/* RSE.C
* - redirect standard error to standard out and execute the command
* passed on the command line.
*
* eg. rse cl -c foo.c > errs
*/
#include <stdio.h>
main(ac, av)
int ac;
char *av[];
{
dup2(fileno(stdout), fileno(stderr)); /* ie. dup2(1, 2) */
execvp(av[1], &av[1]);
}
-----
Don Kneller
UUCP: ...ucbvax!ucsfcgl!kneller
ARPA: kneller@cgl.ucsf.edu
BITNET: kneller@ucsfcgl.BITNET