Home / Minishell

Minishell

July 2025 Systems / CLI C · Unix · Processes

Overview

Minishell is a simplified Unix shell written in C that replicates the core functionality of bash. It provides an interactive command-line interface with command history, process management, pipes, I/O redirections, heredocs, and environment variable expansion.

Built as a 42/Hive Helsinki team project, it demonstrates deep understanding of fork/exec process models, file descriptor management, signal handling, and lexical parsing — all without any higher-level shell libraries.

Key Features

Tech Stack

C Unix Syscalls Readline fork / exec Signals Makefile

My Role

This was a two-person project. I was responsible for the execution layer — implementing pipes, heredocs, built-ins, and signal handling. My partner handled the lexer and parser. I also led the overall integration testing, verifying behaviour against bash across edge cases in pipelines and redirections.

Challenges & Learnings

The trickiest part was correctly propagating file descriptors through a pipeline of arbitrary length while ensuring every duplicate fd is closed in every child and parent process. Getting signal behaviour to exactly match bash — especially inside heredocs and pipelines — required careful re-reading of POSIX signal semantics and incremental testing against the real shell.