home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
-
- READBACK.C
-
- A diagnostic utility. This program reads its arguments and prints them
- to the screen, followed by any text redirected to stdin. Copy this
- program to a different name, such as RMAIL, and you'll be able to see
- what the calling program (like Waffle) is telling it. This can be very
- helpful in figuring out how programs interact.
-
- This program is in the public domain.
-
- *************************************************************************/
-
- #include <stdio.h>
- #include <io.h>
-
- main(int argc, char *argv[]) {
- int x;
-
- for(x=0;x<argc;x++)
- printf("Arg %d: %s\n",x,argv[x]);
- printf("\n");
- if (!isatty(0)) {
- while ((x = getchar()) != EOF) {
- putchar(x);
- }
- }
- }
-