diff options
author | dzwdz | 2021-10-21 06:41:24 +0000 |
---|---|---|
committer | dzwdz | 2021-10-21 06:41:24 +0000 |
commit | d477902853ff07e8aa80fcc10307446680e28749 (patch) | |
tree | f7971001b78587cb185d19af957c4737ab17e261 /src/init/shell.c | |
parent | d026ce97b8faaa2f3f196281b96df0a04e30e4f9 (diff) |
init/shell: add a `catall` cmd - works like the old fs test
Diffstat (limited to 'src/init/shell.c')
-rw-r--r-- | src/init/shell.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/init/shell.c b/src/init/shell.c index 33f6da3..40283f8 100644 --- a/src/init/shell.c +++ b/src/init/shell.c @@ -74,6 +74,16 @@ void shell_loop(void) { printf("%s\n", args); } else if (!strcmp(cmd, "cat")) { cmd_cat(args); + } else if (!strcmp(cmd, "catall")) { + const char *files[] = { + "/init/fake.txt", + "/init/1.txt", "/init/2.txt", + "/init/dir/3.txt", NULL}; + for (int i = 0; files[i]; i++) { + printf("%s:\n", files[i]); + cmd_cat(files[i]); + printf("\n"); + } } else if (!strcmp(cmd, "exit")) { _syscall_exit(0); } else if (!strcmp(cmd, "fork")) { |