+ } else if (streq(cmd, "cat")) {
+ int fd = open(argpart, 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");
+ }