File:  [XINU] / xinu / sys / shell / x_echo.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:39:04 2018 UTC (8 years, 3 months ago) by root
Branches: xinu, MAIN
CVS tags: xinu-19870308, HEAD
Xinu for VAX

/* x_echo.c - x_echo */

#include <conf.h>
#include <kernel.h>

/*------------------------------------------------------------------------
 *  x_echo  -  (command echo) echo arguments separated by blanks
 *------------------------------------------------------------------------
 */
COMMAND	x_echo(stdin, stdout, stderr, nargs, args)
int	stdin, stdout, stderr, nargs;
char	*args[];
{
	char	str[80];
	int	i;

	if (nargs == 1)
		str[0] = NULLCH;
	else {
		for (strcpy(str, args[1]),i=2 ; i<nargs ; i++) {
			strcat(str, " ");
			strcat(str, args[i]);
		}
	}
	strcat(str, "\n");
	write(stdout, str, strlen(str));
	return(OK);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.