xref: /freebsd/contrib/one-true-awk/testdir/echo.c (revision 2008043f386721d58158e37e0d7e50df8095942d)
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