This is our take on the 42 minishell project: a small Unix-like shell built in C.
This project was developed by:
![]() d3bvstack |
![]() marcogmurciano |
The goal was not to clone Bash 1:1, but to build a shell that feels real in day-to-day use: run commands, chain programs with pipes, redirect input/output, use environment variables, handle signals properly, and support the essential builtins you expect.
If libft was about learning C fundamentals, minishell is where everything starts to click together: parsing, process management, file descriptors, signals, and error handling all in one place.
At a high level, you can:
- Run external commands from
PATHor by direct path (/bin/ls,./my_program) - Chain commands with pipes (
|) - Redirect input/output with
<,>,>> - Use heredoc (
<<) to feed multiline input - Expand environment variables (
$HOME,$USER) and last exit code ($?) - Work with single and double quotes
- Use core builtins to navigate and manage your environment
- Handle
Ctrl+CandCtrl+\in a shell-appropriate way
In short: enough to feel like a real shell while staying within minishell scope.
echowith-nflagcdpwdexportunsetenvexit
This project forced me to connect several core systems topics:
- Tokenizing and parsing user input into executable structures
- Building and executing pipelines across multiple processes
- Managing redirections and heredoc safely
- Tracking and propagating exit statuses
- Coordinating parent/child signal behavior
- Maintaining environment state between commands
- Cleaning up memory and resources in long-running interactive loops
This is a pedagogical shell, not a full Bash replacement.
So things like advanced Bash features are out of scope here (for example: &&, ||, command substitution, wildcards/globbing, job control, aliases, etc.).
From the project root:
make
./bin/minishellUseful targets:
make clean
make fclean
make resrc/tokenization: splits raw input into tokenssrc/syntax: builds command structures and validates syntaxsrc/expansion: handles$VARIABLEand$?expansionsrc/execution: runs commands, pipelines, redirections, heredoc logicsrc/builtins: shell builtinssrc/signals: interactive signal behaviorsrc/environment: environment list/array management
This project is where "I know C syntax" turns into "I can build systems software with C".
It is opinionated, scoped, and intentionally not everything under the sun, but it covers the heart of what makes a shell a shell.

