From 93016659c65a11390142bed52b3a1c7bb9e1350a Mon Sep 17 00:00:00 2001 From: call-cc Date: Mon, 1 Jun 2020 15:37:33 -0400 Subject: [PATCH] Add echo --- src/echo.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/echo.c diff --git a/src/echo.c b/src/echo.c new file mode 100644 index 0000000..c489f6c --- /dev/null +++ b/src/echo.c @@ -0,0 +1,14 @@ +#include +#include +#include + +int +main(int argc, char *argv[]) +{ + while(*argv) { + (void)fputs(*argv, stdout); // Print argv + if(*++argv) putchar(' '); // If multiple things in argv, print a space between them. + } + putchar('\n'); + return 0; +}