diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-25 04:42:09 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-25 04:42:09 +0200 |
commit | eadcf720c085e2a51bc1c74b6fa59951cda08895 (patch) | |
tree | c43b21ff18d8a058dae72c32be709a6bd7a3f728 /Userland | |
parent | 737315c2280341ba6ba14f730d5cfdf43009bd0f (diff) | |
download | serenity-eadcf720c085e2a51bc1c74b6fa59951cda08895.zip |
Userland: Add a simple /bin/echo program.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/echo.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/echo.cpp b/Userland/echo.cpp new file mode 100644 index 0000000000..3dbacd26a1 --- /dev/null +++ b/Userland/echo.cpp @@ -0,0 +1,12 @@ +#include <stdio.h> + +int main(int argc, char** argv) +{ + for (int i = 1; i < argc; ++i) { + fputs(argv[i], stdout); + if (i != argc - 1) + fputc(' ', stdout); + } + printf("\n"); + return 0; +} |