2023–2025
Minishell
A simple Unix shell written in C that emulates the basic features of bash: built-in commands, pipes, redirections, heredoc, environment variable expansion and signal handling.
My role
Team project. I mainly built the parser and collaborated on the execution part.
Context
Minishell is one of the projects in the 42 curriculum, written in C as a small version of bash.
Problem
A shell sits between the user and the operating system. Writing one means reading a command line correctly, then running it through system calls: finding programs, wiring pipes and redirections, and reacting to signals the way users expect.
What I built
Parsing (my main part)
I built the parser. Lexical analysis breaks the input into tokens, the parser groups them into commands, and environment variables are expanded to their values.
Execution (shared)
I collaborated on execution. Built-in commands run inside the shell: echo (with -n), cd, pwd, export, unset, env and exit. External commands are found through PATH and run through system calls, with pipes and redirections (>, >>, < and <<, using a custom heredoc) set up around them. Ctrl+C, Ctrl+D and Ctrl+\ are handled.
Architecture
Two parts: parsing (lexer, parser, expansion) and execution (built-ins, external commands, redirections and pipes). The repository holds the headers in includes/, a custom library in libft/, the sources in srcs/ and a Makefile.
Outcome
A working shell with seven built-ins, pipes, four redirection operators with a custom heredoc, environment variable expansion and signal handling.
Stack
- C
- POSIX
- UNIX/Linux