This project has been created as part of the 42 curriculum by zotaj-di, baelgadi.
MiniDevil is a POSIX inspired shell written in C as part of the 42 school minishell project.
It reads commands from the terminal, tokenizes & parses them into an AST (Abstract Syntax Tree) then executes the tree: handling pipes, redirections, environment variables and more, just like bash.
MiniDevil in action: pipes, redirections, heredoc and the UI mode
git clone https://github.com/L3awdMan/MiniDevil.git
cd MiniDevil
make
./minishellWant the extra UI mode (not in subject)?
./minishell --uiNote
The cd builtin command is not supported through the UI.
- Interactive prompt with command history (readline)
- PATH based executable search and absolute OR relative path execution
- Single and double quote handling:
'prevents all interpretation"allows for$expansion
- Redirections:
<(input)>(output)>>(append)<<(heredoc)
- Pipes (
|) connecting STDOUT to STDIN across commands - Environment variable expansion (
$VAR,$?...) - Signal handling:
CTRL C(new prompt)CTRL D(exit)CTRL \(ignored)
- Builtins:
echo,cd,pwd,export,unset,env,exit
&&and||operators- Parentheses
()for subshell - Wildcard
*globbing (in the current directory)
Note
libft is vendored under ./libft/ and builds automatically as part of make — no manual setup needed.
- GCC or CC compiler
- GNU Make
- readline library (
libreadline-devon Debian/Ubuntu)
make # builds the mandatory part
make bonus # builds the bonus part./minishell
# UI Mode (extra, not in subject)
./minishell --uimake clean # remove object and dependency files
make fclean # clean + remove binary
make re # full rebuildFurther information is provided in the documentation.
Caution
The explanations in this repository are not intended to encourage cheating or any behavior that goes against 42's rules. Their purpose is to support the peer-to-peer learning system. Bader and I do not encourage, support, or take responsibility for any form of cheating related to this repository.
Important
If you have read our explanations carefully, you will understand that they are not enough on their own .. you still need to do your own research.
- Bash Reference Manual (GNU)
- GNU Readline Library
- Valgrind Memcheck: Different ways to lose your memory
AI tools (Claude) were used during this project for:
- Debugging assistance and code review
- Better understand core concepts and some edge cases
- Acting as a rubber duck colleague (making sure the Doxygen comments and pages were understandable and accurate)
- Greatly improved documentation by helping correct and refine it (Doxyfile & Doxygen xml/css/shell script)
- Helping structure the bonus architecture in an efficient way




