xref: /freebsd/contrib/one-true-awk/testdir/echo.c (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1 #include <stdio.h>
2 #include <string.h>
3 
4 int main(int argc, char *argv[])
5 {
6 	int i, start, minusn;
7 
8 	start = 1;
9 	minusn = 0;
10 	if (argc > 1 && strcmp(argv[1], "-n") == 0) {
11 		start = 2;
12 		minusn = 1;
13 	}
14 
15 	for (i = start; i < argc; i++)
16 		printf("%s%s", argv[i], i==argc-1 ? "" : " ");
17 	if (minusn == 0)
18 		printf("\n");
19 }
20