This project has been created as part of the 42 curriculum by jsilveir, vsoares-.
Minishell is a simplified shell implementation that replicates core functionalities of bash. The goal of this project is to understand how a shell works by building one from scratch, including process creation, file descriptor manipulation, signal handling, and command parsing.
- Interactive prompt with command history
- Command execution via
PATHlookup or absolute/relative paths - Built-in commands:
echo,cd,pwd,export,unset,env,exit - Redirections:
<,>,<<(heredoc),>> - Pipes: connect multiple commands with
| - Environment variable expansion:
$VARand$?for exit status - Quote handling: single quotes
'...'and double quotes"..." - Signal handling:
Ctrl+C,Ctrl+D,Ctrl+\
- GCC compiler or compatible C compiler
- GNU Make
- readline library (
libreadline-devon Debian/Ubuntu)
makeThis will compile the project and generate the minishell executable.
make clean # Remove object files
make fclean # Remove object files and executable
make re # Rebuild the project./minishellOnce running, you can use it like a regular shell:
minishell$ echo "Hello, World!"
Hello, World!
minishell$ ls -la | grep minishell
minishell$ cat < input.txt > output.txt
minishell$ export MY_VAR=42
minishell$ echo $MY_VAR
42
minishell$ exit- Bash Reference Manual - Official GNU Bash documentation
- The Open Group Base Specifications - Shell Command Language - POSIX shell specification
- Writing Your Own Shell - Tutorial on shell implementation
- Readline Library Documentation - GNU Readline manual
AI assistance was used for:
- Learning and understanding key concepts: Explaining how certain concepts of the shell syntaxt and behavior work
- Code review and bug identification: Analyzing existing code to find potential issues, memory leaks, and norm violations
- Documentation: Generating and formatting README documentation and project checklists
- Refactoring suggestions: Identifying duplicate code and proposing structural improvements
All core implementation (parsing, execution, builtins, redirections, pipes, signals) was written manually by the project authors.