A small Unix shell written in C, inspired by Bash, developed as a team project at 42 Heilbronn.
The goal was to recreate core shell functionality while working directly with Unix processes, file descriptors, pipes, signals, and system calls.
- Command execution
- Pipes (
|) - Redirections (
<,>,>>,<<) - Environment variables &
$? - Single & double quotes
- Built-ins:
echo,cd,pwd,export,unset,env,exit - Signal handling
- Process & file descriptor management
We divided the project into two clearly defined parts:
User Input
│
▼
┌──────────┐
│ Parser │ ← Project Partner
└────┬─────┘
│
▼
Parsed Commands
│
▼
┌───────────┐
│ Execution │ ← Paula
└─────┬─────┘
│
▼
Processes / Pipes / Redirections
This separation made development efficient and easy to coordinate. With a clear interface between parsing and execution, we could work in parallel, test our components independently, and isolate bugs more easily.
I focused on the execution layer, including:
- Process creation with
fork() - Command execution with
execve() $PATHresolution- Pipes & file descriptors
- Input/output redirections
- Here-documents
- Built-in execution
- Process synchronization with
waitpid() - Exit status handling
- Signals & error handling
Clone the repository and compile:
git clone <repository-url>
cd minishell
makeRun the shell:
./minishellmake # Compile
make clean # Remove object files
make fclean # Remove object files and executable
make re # Recompile$ echo "Hello, Minishell!"
Hello, Minishell!
$ ls | grep ".c" | wc -l
5
$ export NAME=Paula
$ echo "Hello $NAME"
Hello Paula