summaryrefslogtreecommitdiff
path: root/Userland/echo.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-25 04:42:09 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-25 04:42:09 +0200
commiteadcf720c085e2a51bc1c74b6fa59951cda08895 (patch)
treec43b21ff18d8a058dae72c32be709a6bd7a3f728 /Userland/echo.cpp
parent737315c2280341ba6ba14f730d5cfdf43009bd0f (diff)
downloadserenity-eadcf720c085e2a51bc1c74b6fa59951cda08895.zip
Userland: Add a simple /bin/echo program.
Diffstat (limited to 'Userland/echo.cpp')
-rw-r--r--Userland/echo.cpp12
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;
+}