duke shell

$ a custom Unix shell implementation

overview

DukeSH is a custom shell program that supports command execution, process management, I/O redirection, and piping. Built in C, it was developed to deepen understanding of how processes and system calls work at the OS level.

The shell supports built-in commands alongside external executables, handles foreground and background processes, and implements a basic REPL loop with proper signal handling.

tech stack

  • C: system calls, process lifecycle, file descriptors
  • Makefile: build process and dependency management

takeaways

This project was very valuable in teaching about the process lifecycle and system calls. Not only did it help me become a better C programmer, its primary value was in how it deepened my understanding of operating system concepts. Building a shell from scratch gave concrete understanding of how processes are created, managed, and terminated, and how shells themselves work under the hood. Some key takeaways:

  • Process management, fork, exec, wait, and signal handling
  • I/O redirection and pipe implementation using file descriptors
  • Robust error handling in systems-level C code