Overview
Minishell is a Unix shell implemented from scratch in C as part of the 42 Prague curriculum, built with a partner under strict coding standards. It reproduces core Bash behavior end to end: an interactive prompt with command history via GNU Readline, a lexer and parser that turn raw input into an executable command structure, environment variable expansion, and a process-based executor that runs built-ins and external binaries.
Architecture
The codebase is split into a lexer/parser/expander pipeline (lexer.c, lexer_token.c, lexer_extract.c, parser.c, parser_utils.c, expander.c, expander_utils.c) that turns raw input into a structured command list, and an execution layer (executor.c, executor_utils.c, path_finder.c, redirections.c, heredoc.c, wait.c) that forks processes, wires up pipes and file descriptors, and waits on children. Built-in commands run in-process rather than being forked, and a dedicated environment layer (env.c, env_utils.c) manages the shell's variable list independently of the OS environment array. A custom libft utility library backs the string and memory helpers used throughout.
Technologies Used
Written in C targeting Linux/Unix, using POSIX system calls (fork, execve, waitpid, dup2, pipe) for process and file-descriptor control, GNU Readline for interactive input and history, and a custom libft utility library for string and memory helpers.