Minishell

A functional Unix shell built from scratch in C, modelled after bash. This project required deep understanding of how a shell actually works under the hood — from parsing user input to managing processes and file descriptors.

Minishell demo

What it does

  • Lexing and parsing of shell commands including quotes and special characters
  • Pipes — chaining commands with |
  • Input/output redirections — <, >, >>, heredoc <<
  • Environment variable expansion and $? exit status
  • Built-in commands: echo, cd, pwd, export, unset, env, exit
  • Signal handling for Ctrl+C, Ctrl+D, Ctrl+\
  • Process management with fork, execve and wait

Tech Stack

  • C — manual memory management, no leaks allowed
  • POSIX system calls — fork, execve, pipe, dup2, waitpid, sigaction
  • Readline library for input history and line editing