███╗ ███╗██╗███╗ ██╗██╗███████╗██╗ ██╗███████╗██╗ ██╗
████╗ ████║██║████╗ ██║██║██╔════╝██║ ██║██╔════╝██║ ██║
██╔████╔██║██║██╔██╗ ██║██║███████╗███████║█████╗ ██║ ██║
██║╚██╔╝██║██║██║╚██╗██║██║╚════██║██╔══██║██╔══╝ ██║ ██║
██║ ╚═╝ ██║██║██║ ╚████║██║███████║██║ ██║███████╗███████╗███████╗
╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
A minimal UNIX shell — built from scratch at École 42 Le Havre
Minishell is a project from the 42 curriculum that challenges students to implement a functional UNIX shell in C. The goal is to deeply understand how a shell works — process creation, file descriptors, signals, and how the terminal interprets commands.
"The most important thing we've ever engineered is the shell."
| Feature | Description |
|---|---|
| 🖥️ Interactive prompt | Displays a prompt and waits for user input |
| 📜 Command history | Navigate previous commands with ↑ / ↓ |
| 🔍 PATH resolution | Finds and executes binaries from $PATH |
| 🔗 Pipes | Chain commands with | |
| ↩️ Redirections | >, >>, <, << (heredoc) |
| 💬 Quotes | Handles single ' and double " quotes |
| 🌍 Environment variables | Expands $VAR and $? |
| ⚡ Signals | ctrl-C, ctrl-D, ctrl-\ behave like bash |
| 🔧 Builtins | Full implementation of all required builtins |
echo [-n] # Print text to stdout
cd [path] # Change current directory
pwd # Print working directory
export [name[=value]] # Set environment variables
unset [name] # Remove environment variables
env # Print environment
exit [status] # Exit the shellgccorclangmakereadlinelibrary
# macOS
brew install readline
# Linux (Debian/Ubuntu)
sudo apt-get install libreadline-devgit clone git@github.com:LnnRust/Minishell.git
cd Minishell
make./Minishellminishell$ echo "Hello, World!"
Hello, World!
minishell$ ls -la | grep .c | wc -l
42
minishell$ export NAME=student && echo "Hi $NAME"
Hi student
minishell$ cat << EOF
> this is a heredoc
> EOF
this is a heredoc
minishell$ exit
- Bash Reference Manual
- Writing Your Own Shell
- GNU Readline
- The Linux Programming Interface — Michael Kerrisk
aandreo fbenech memillet
This project is part of the 42 curriculum. Do not copy or submit it as your own work.
Made with ☕ and way too many segfaults at 42