SCHOOL · PROJECT

minishell

Mini POSIX shell implementation

GitHub Repo
CParsingProcessSignalsPipes

Overview

minishell is a miniature shell written in C. It supports parsing, environment variables, pipes and redirections, built-in commands, and robust signal handling.

Highlights

  • Tokenizer + parser producing an AST
  • Pipes and redirections with proper FD management
  • Built-ins: cd, echo, env, export, unset, pwd, exit
  • Signal handling for interactive UX (SIGINT, SIGQUIT)

Technical Details

  • Exec module forks and orchestrates pipelines
  • Careful error propagation and exit statuses
  • Memory arenas and cleanup after each command
  • Tested against common edge cases (quotes, escapes)

Challenges

  • Designing a clean grammar and AST
  • Deadlock and FD leak avoidance
  • Signal interactions across parent/child

What I Learned

  • Unix process model and IPC
  • Practical parsing strategies
  • Shell ergonomics and error UX
minishell · Projects · Mohamed Kobaa