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