|
|
1.1 ! root 1: /* x_echo.c - x_echo */ ! 2: ! 3: #include <conf.h> ! 4: #include <kernel.h> ! 5: ! 6: /*------------------------------------------------------------------------ ! 7: * x_echo - (command echo) echo arguments separated by blanks ! 8: *------------------------------------------------------------------------ ! 9: */ ! 10: COMMAND x_echo(stdin, stdout, stderr, nargs, args) ! 11: int stdin, stdout, stderr, nargs; ! 12: char *args[]; ! 13: { ! 14: char str[80]; ! 15: int i; ! 16: ! 17: if (nargs == 1) ! 18: str[0] = NULLCH; ! 19: else { ! 20: for (strcpy(str, args[1]),i=2 ; i<nargs ; i++) { ! 21: strcat(str, " "); ! 22: strcat(str, args[i]); ! 23: } ! 24: } ! 25: strcat(str, "\n"); ! 26: write(stdout, str, strlen(str)); ! 27: return(OK); ! 28: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.