Skip to main content
Back to index

04Project

Repository

Minishell

A UNIX shell — processes, pipes, redirections, signals

A command interpreter written in C: process creation, pipe chaining, redirections, environment variables and signal handling.

Context

A shell is a great revealer: it forces you to properly understand `fork`, `execve`, `dup2` and `waitpid` — and above all to handle the edge cases, like a redirection that fails, a signal received while a child is running, or a command that cannot be found in the middle of a pipeline. Parsing took as much work as execution: quotes, expansions and operators have to be processed in the right order for the behaviour to match bash.

Features

  • 01Complete UNIX command interpreter
  • 02Pipe and redirection handling
  • 03Environment variables and signals
  • 04Built-ins: echo, cd, pwd, export, unset, env, exit
  • 05Command history
  • 06Robust parsing with error handling

Screenshots

01 / 04
Minishell01 / 04
Screenshot of Minishell (1/4)