A minimalist command interpreter developed as a 42 school project.
Minishell is a simplified implementation of a POSIX shell that replicates the basic functionalities of Bash. It includes:
- Lexer: Input tokenization with quote handling
- Parser: Syntax analysis and command tree construction
- Executor: Command execution with pipe and redirection support
- Builtins: Internal commands (cd, export, unset, echo, exit, pwd, env)
- Expander: Environment variable expansion
- Redirections: Standard input/output and heredocs
- GCC or Clang
- GNU Make
- Readline library (
libreadline-devon Debian/Ubuntu)
makeTo clean object files:
make cleanTo remove everything (including the executable):
make fcleanTo rebuild from scratch:
make re./minishellOnce started, you can execute commands like in a normal shell:
minishell> echo "Hello World"
minishell> ls -la
minishell> cat file.txt | grep word > output.txt
minishell> exitsrc/
├── core/ # Main core (signals, initialization)
├── lexer/ # Lexical analysis (tokenization)
├── parser/ # Syntax analysis
├── executor/ # Command execution
├── builtins/ # Internal commands
├── expander/ # Variable expansion
├── env/ # Environment management
└── redirection/ # Redirection and heredoc handling
- serjimen - Sergio Jiménez
- vjan-nie - Vadim Jan
This project implements a functional but simplified shell. It does not include all Bash features, focusing on the fundamental logic of a command interpreter.