System Programming
C Architecture
42sh is a major project in the EPITA curriculum. The goal is to develop a POSIX-compliant shell capable of interpreting scripts and handling user interaction, similar to Bash.
While access to the standard C library is allowed, specific helper functions like system,
glob, regexec, and wordexp were strictly forbidden.
This constraint forced us to manually reimplement complex logic such as pattern matching and command execution flows.
Key technical achievements include robust pipeline orchestration, recursive descent parsing generating an Abstract Syntax Tree (AST), and signal handling.
We successfully validated the project up to Step 4. The shell supports:
if/else/elif, while, until, for loops, and case statements.fork, execve (and execvp), and waitpid.|) and redirections (>, <, >>, <<).$var, ${var}), return codes ($?), and Process ID ($$).cd, exit, export, unset, continue, break, and source (dot).The project was built using professional industry tools:
-Werror -Wall -Wextra -pedantic).autoreconf, configure, make).
This project was an intensive deep dive into software architecture and the Unix philosophy. It required rigor in memory management (detecting leaks with Valgrind) and reliability. Note: The source code is private due to academic integrity rules.