BACKEND SYSTEMS

Minishell

Minishell is a simplified Unix shell built from scratch in C that reproduces the behavior of common POSIX-compatible shells. The project focuses on process creation, command parsing, inter-process communication, file descriptor management, and signal handling while using only low-level Unix system calls.

YEAR

2023

ROLE

Designed • Developed • Shipped

STACK

Cfork()execve()wait()waitpid()pipe()

01/PROBLEM → SOLUTION

02/SYSTEM ARCHITECTURE

How the system fits together

  1. Terminal
  2. Lexer
  3. Parser
  4. AST Builder
  5. Executor
  6. fork · execve · pipe
DRAG / SWIPE TO PAN DIAGRAM
UserTerminalSTANDARD INPUTLexerTOKENIZATIONParserSYNTAX VALIDATIONAST BuilderCOMMAND STRUCTSExpansion EngineENVIRONMENT VARIABLESExecutorPROCESS ORCHESTRATORBuilt-insCD · ECHO · EXITOS System CallsFORK · EXECVE · PIPE · DUP2KernelPROCESS CREATION

Drag to pan or Hover to trace or Click to inspect

03/KEY ENGINEERING DECISIONS

Stage Separation

Tokenization, parsing, and execution live in dedicated modules so each can be debugged and tested independently.

Early Validation

Syntax validation runs before execution, preventing needless process creation and surfacing clear errors pre-syscall.

Raw Syscalls

Built-ins and pipelines run on fork(), execve(), pipe(), dup2() with no shell library, exposing the full process path.

04/IMPACT & TAKEAWAYS

POSIX-Style Coverage. Reproduces common shell behavior: pipes, redirections, env expansion, signals, exit codes.

Zero-Library Build. Every stage from lexical analysis to orchestration implemented by hand in C.

Signal Discipline. Interactive signals (Ctrl-C, Ctrl-D) handled alongside execution.