USG_PG3/usr/source/cmd2/echo.c

Compare this file to the similar file:
Show the results in this format:

main(argc, argv)
	int argc;
	char *argv[];
	{
	register c;
	register char *i, **v;

	if((c = argc - 1) == 0) {
		write(1, "\n", 1);
		exit(0);
	}
	v = ++argv;
	do {
		for(i = *v++; *i++; );
		--i;
		if(--c>0)
			*i++ = ' ';
		else {
			if(*--i != ' ') {
				i++;
				*i++ = '\n';
			}
			write(1, *argv, i =- *argv);
		}
	} while(c>0);
}