xref: /titanic_44/usr/src/ucbcmd/echo/echo.c (revision b7f45089ccbe01bab3d7c7377b49d80d2ae18a69)
1 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
2 /*	  All Rights Reserved  	*/
3 
4 
5 /*
6  * Copyright (c) 1980 Regents of the University of California.
7  * All rights reserved. The Berkeley software License Agreement
8  * specifies the terms and conditions for redistribution.
9  */
10 
11 /*
12  * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
13  * All Rights Reserved.
14  */
15 
16 #ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1	*/
17 
18 /*
19  * echo
20  */
21 #include <stdio.h>
22 
23 main(argc, argv)
24 int argc;
25 char *argv[];
26 {
27 	register int i, nflg;
28 
29 	nflg = 0;
30 	if(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'n' && !argv[1][2]) {
31 		nflg++;
32 		argc--;
33 		argv++;
34 	}
35 	for(i=1; i<argc; i++) {
36 		fputs(argv[i], stdout);
37 		if (i < argc-1)
38 			putchar(' ');
39 	}
40 	if(nflg == 0)
41 		putchar('\n');
42 	exit(0);
43 }
44