summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzwdz2021-10-10 15:45:09 +0000
committerdzwdz2021-10-10 15:45:09 +0000
commitda69044a4654d86bada80eb1c09b6bf85f34f6a5 (patch)
tree60e952cd38f67d91032bfa2c111661b70b466fba
parente5077ed02c7e617583fe381db77de6e0faac1af6 (diff)
init/shell: implement the echo command
-rw-r--r--src/init/shell.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/init/shell.c b/src/init/shell.c
index 12382e0..a43bd20 100644
--- a/src/init/shell.c
+++ b/src/init/shell.c
@@ -53,6 +53,10 @@ void shell_loop(void) {
printf(PROMPT);
readline(cmd, 256);
args = split(cmd);
- printf(" %s | %s\n", cmd, args);
+ if (!strcmp(cmd, "echo")) {
+ printf("%s\n", args);
+ } else {
+ printf("unknown command :(\n");
+ }
}
}