glibc/stdio/xbug.c

22 lines
362 B
C
Raw Normal View History

1994-05-23 23:35:24 +00:00
#include <stdio.h>
main()
{
char * filename = "xbug.c";
FILE *input;
int i;
char buf[256];
if (!freopen (filename, "r", stdin))
fprintf(stderr, "cannot open file\n");
if (!(input = popen("/bin/cat", "r")))
fprintf(stderr, "cannot run \n");
while(gets(buf) != NULL) {
fprintf(stdout, "read: %s\n", buf);
}
}