š Minishell
Minishell is a Unix-like shell developed entirely in C following the strict rules of the 42 Barcelona curriculum.
The project recreates essential shell behavior: parsing, pipes, redirections, environment variables, signals, and process execution, all while ensuring zero memory leaks and handling complex edge cases.
š Features
š¹ Command Execution
- Handles simple commands (
ls,echo,grep, etc.) - PATH resolution
- Built-in optimization for internal commands
š¹ Pipes (|)
Support for executing pipelines such as:
š¹ Redirections
- Input
< - Output
> - Append
>> - Heredoc
<<
š¹ Builtins Implemented
cdechopwdexportunsetenvexit
š¹ Signals
- Custom handling for:
Ctrl+CCtrl+\Ctrl+D
š¹ Error & Memory Management
- No leaks (checked with
valgrind) - Graceful error messages
- Defensive programming against invalid syntax
š§ What I Learned
- Tokenization, parsing and abstract syntax tree logic
- Linux process management (
fork,execve,wait) - File descriptors and
dup2() - Handling race conditions and edge cases
- Writing clean and modular low-level C code
- Full debugging workflow using Valgrind & GDB
š Repository
š GitHub: https://github.com/zmetreveli/minishell