← Back
42sh
POSIX shell in C, written from scratch in the Bash style. As a team, with lexer, parser, AST, full execution, and all expansions hand-rolled (variables, globbing, arithmetic).
STACK
HIGHLIGHTS
- Complete front-end: hand-written lexer and recursive-descent parser, AST with reparseable pretty-printer for debugging, GNU Autotools build.
- Control flow: if/else, while, until, for, case, functions, command blocks and subshells, lists, and pipelines.
- Expansions and quoting: variables, command substitution, arithmetic, tilde, globbing, field splitting. All hand-rolled, since the dedicated libc helpers were forbidden by the assignment.
- Full redirections (every variant, here-documents included) and the && and || logical operators.
- Essential builtins (cd, export, unset, alias, exit, echo, sourcing, break/continue) and a differential functional test suite against bash --posix. Strict file-descriptor handling, zero memory leaks.