+sigint_handle(int signum)
+{
+ return;
+}
+
+void
+do_cat(const char* file)
+{
+ int fd = open(file, 0);
+ if (fd < 0) {
+ sh_printerr();
+ } else {
+ int sz;
+ while ((sz = read(fd, cat_buf, 1024)) > 0) {
+ write(stdout, cat_buf, sz);
+ }
+ if (sz < 0) {
+ sh_printerr();
+ }
+ close(fd);
+ printf("\n");
+ }
+}
+
+void
+do_ls(const char* path)
+{
+ int fd = open(path, 0);
+ if (fd < 0) {
+ sh_printerr();
+ } else {
+ struct dirent ent = { .d_offset = 0 };
+ int status;
+ while ((status = readdir(fd, &ent)) == 1) {
+ if (ent.d_type == DT_DIR) {
+ printf(" \033[3m%s\033[39;49m\n", ent.d_name);
+ } else {
+ printf(" %s\n", ent.d_name);
+ }
+ }
+
+ if (status < 0)
+ sh_printerr();
+
+ close(fd);
+ }
+}
+
+void
+sh_loop()