xv6-riscv-kernel/user/echo.c

20 lines
298 B
C
Raw Permalink Normal View History

#include "kernel/types.h"
#include "kernel/stat.h"
#include "user/user.h"
2006-07-29 00:33:07 +02:00
int
main(int argc, char *argv[])
{
int i;
2024-06-15 16:55:06 +02:00
for(i = 1; i < argc; i++) {
2019-09-04 16:12:53 +02:00
write(1, argv[i], strlen(argv[i]));
2024-06-15 16:55:06 +02:00
if(i + 1 < argc) {
2019-09-04 16:12:53 +02:00
write(1, " ", 1);
} else {
write(1, "\n", 1);
}
}
exit(0);
2006-07-29 00:33:07 +02:00
}