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
01/PROBLEM → SOLUTION
PROBLEM
The parser must validate many token patterns (quotes, pipes, redirections, expansions) before execution; naive parsing breaks shell behavior.
SOLUTION
A staged pipeline separates Lexer, Parser, AST Builder, and Executor; syntax is validated before any process creation, so errors are meaningful.
02/SYSTEM ARCHITECTURE
How the system fits together
- Terminal
- →Lexer
- →Parser
- →AST Builder
- →Executor
- →fork · execve · pipe
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.