Custom Unix Shell

Systems Programming • 2025 • Course Project

Overview

A custom-built Unix shell written in C, supporting piping, redirection, and batch mode. Designed to mimic real-world shell behavior while improving on error handling and command feedback.
Role: Systems Programmer
Tools: C, Linux, bash

Problem

Unix shells are essential developer tools, but understanding their behavior requires building one from scratch. This project challenged me to replicate and extend core shell features like piping, conditional execution, and redirection—while ensuring the shell remained robust and easy to debug.

My Approach

  • Built a parser to tokenize commands and detect syntax patterns
  • Implemented fork-exec behavior and parent-child process coordination
  • Supported batch and interactive modes with prompt logic and EOF handling
  • Handled piping (`|`), redirection (`<`, `>`), and conditionals (`&&`, `||`) manually
  • Tested rigorously using rc/gc clients and malformed inputs
  • UX Decisions

    Final Build

    Fully functional C-based shell supporting core Unix features and structured error messaging. Designed for concurrency and manual control of system calls. Tested successfully across dozens of edge cases in a Linux environment.

    Terminal screenshot of shell running

    Reflection

    This was the most technically intense project I’ve completed in C. It pushed me to manage processes, memory, and input handling without any safety net—and helped me appreciate how even low-level tools benefit from intentional UX decisions. I'm especially proud of the rematch logic, clean shutdown, and piping support.

    ← Back to Portfolio