Welcome to the Minishell Organization – a collaborative effort to build a fully functional shell in C as part of the 42 school curriculum.
Minishell is a simplified Unix shell designed to mimic the behavior of /bin/bash. It supports command parsing, input/output redirections, pipelines, environment variable expansion.
This organization splits the project into two main components to support clean development and collaboration:
Owner: Hamza Wahmane
This repository focuses on the parsing logic, including:
- Lexical analysis and tokenization
- Grammar parsing (AST generation)
- Command and redirections arrange
&&and||with()for priorities- Quote and escape handling
- Syntax validation and error handling
Owner: Abdellah Nsila
This repository handles the execution engine of the shell. It is responsible for:
- Dollar
$expansion ($VAR,$?) - Wildcard
*expansion (*,ls *) - Process forking and
execvecalls - Built-in command handling
- Redirections (
<,>,>>,<<) - Pipes (
|) - Subshells and grouping
- Environment management
- File descriptor restoration and isolation
We follow a modular development approach:
- Parsing builds the AST (Abstract Syntax Tree) and handles all user input processing.
- Execution receives the AST and interprets it to run commands accurately.
Communication between the two repositories happens through a shared structure (AST nodes and enums) and clearly defined interfaces.
Each repository can be compiled separately, but to run the shell completely:
- Link the parser output into the executor.
- Use
Makefilecoordination or a script to compile and merge both.
- Tokenization and Parsing
- AST Generation
- Built-in Commands (
cd,echo,export, etc.) - Input/Output Redirections
- Heredoc (
<<) - Pipes (
|) - Subshells (
(cmd)) - Manage fds, filesm redirs (
(<, <<, >, >>)) - Environment Variable Expansion
- Wildcard expansion (
*) (optional) - Signal handling refinement
- Exit code manipulation
- Test complex commands
- Join Parsing with execution
- Error and memory management
- Optimize, clean up files and stream logic
- Push 125/100
- Hamza Wahmane – Parsing Logic
- Abdellah Nsila – Execution Logic
This project is developed as part of the 42 School curriculum. All code is original and follows the guidelines set by the 42 Network.
This shell is educational and built under restricted conditions:
- No use of external libraries
- Limited standard C functions
- Manual memory and error management
The goal is to deeply understand how a real shell works internally.
Happy Hacking 💻