A minimal Unix shell implementation built in C, replicating key behavior of Bash. Developed for educational purposes.
- Command execution with arguments (e.g.,
ls -l,echo hello) - Built-in commands:
cd,echo,pwd,exit,export,unset,env
- Input parsing with support for:
- Quoting (
',") - Environment variable expansion (
$VAR) - Redirections (
>,>>,<,<<) - Pipes (
|)
- Quoting (
- Signal handling (Ctrl+C, Ctrl+, Ctrl+D)
- Error handling with descriptive messages
- No memory leaks (checked with valgrind)
- Unix-based OS (Linux or macOS)
cccompilermake
./minishellYou can now enter commands like:
ls -l | grep ".c" > files.txt
cat < files.txtUse exit to quit the shell.
minishell/
├── src/ # Source files
├── inc/ # Header files
├── mylib/ # Custom standard library functions
├── Makefile
└── README.md
- Run
valgrind ./minishellto check for memory leaks - Compare behavior with
/bin/bashfor edge cases
This project follows the specifications from the 42 School minishell subject. It mimics Bash 5.1 behavior wherever possible.