ack/first/myecho.c

22 lines
294 B
C
Raw Normal View History

1987-03-16 23:32:34 +00:00
#include <stdio.h>
main(argc, argv)
int argc;
char *argv[];
{
int nflag = 0;
if(argc > 1 && ! strncmp(argv[1], "-n", 2)) {
nflag++;
argc--;
argv++;
}
while (--argc > 0) {
fputs(argv[1], stdout);
argv++;
if (argc > 1) putchar(' ');
}
if (!nflag) putchar('\n');
exit(0);
}