🔔 Before you start 🔔
This project is part of the 42 computer programming schools common-core curriculum. 42 is a non-profit educational organization characterized by its peer-to-peer and project-based learning method. You'll find the subject of the project in the repository.
- 🛫 Intro
- ✨ Characteristics
- 🛠️ Tools used
- 🚀 Quick guide
- 🎨 Bonus
- 📖 Training report
- 🏆 Acquired skills
- 🔧 Future improvement and/or next steps
- 🤝 Acknowledgements
- 📚 References
minishell is a simplified Unix shell recreated as part of the 42 curriculum. The goal is to replicate the core behavior of a bash-like shell by handling user input, parsing commands, managing processes, and mimicking the environment in which real-world shells operate.
The project encourages an in-depth understanding of process control, file descriptors, signals, and parsing logic, all while conforming to the strict coding norms of 42.
- Implements a command-line interface supporting:
- Built-in commands:
echo,cd,pwd,export,unset,env,exit - Redirections:
>,>>,<,<<(here-doc) - Pipes:
| - Quoting rules: single
'and double"quotes - Environment variable expansion:
$VAR
- Built-in commands:
- Error handling for invalid syntax and command failure
- Signal handling (
SIGINT,SIGQUIT,EOF) that mimics bash behavior - Minimal memory leaks (checked with Valgrind)
| Tool/Lib | Purpose |
|---|---|
readline |
Handles command history and editing |
termios.h |
Terminal behavior configuration |
unistd.h |
Access to execve, fork, pipe, dup2 |
stdlib.h |
Memory allocation |
signal.h |
Signal handling |
string.h |
String operations |
fcntl.h |
File descriptor manipulation |
This project was developed and tested on Linux, using the GNU readline library.
Clone the repository and compile using make:
git clone https://github.com/YOUR_USERNAME/minishell.git
cd minishell
make
./minishell
