Project archive

minishell

42 Lisboa · Collaborative systems project

A shell prompt hides a lot of machinery: parsing, processes, file descriptors, signals, ownership, and cleanup.

Flagship case study2026

$ echo a | cat > outexit 0

ownership follows every branch

Year
2026
Language
C
Context
42 Lisboa
Stack
C · Readline · Parsing · Unix Processes
Collaborator
Guilherme

What I owned.

01 · Personal contribution

We split the project between parsing and execution. I handled execution after parsing: pipelines, redirections, built-ins, signals, external commands, and memory cleanup across those paths.

How it works.

02 · Architecture

  1. 01

    Command handoff

    The parsed command structure becomes an execution plan that distinguishes built-ins, external programs, redirections, and pipeline stages.

  2. 02

    Process orchestration

    Forks, pipes, duplicated file descriptors, exit statuses, and signal behavior are coordinated without leaking resources between parent and child paths.

  3. 03

    Lifecycle discipline

    Environment state and temporary allocations have explicit cleanup paths, including failures and heredoc interruption.

The problem I had to solve.

03 · Hardest problem

Memory leaks were the hardest challenge. I traced every failure path from allocation to cleanup.

The result.

04 · Result

The finished shell handles pipelines, redirections, built-ins, signals, and external commands. The repository also records the fixes made around pipes, parsing boundaries, and memory leaks.

What I learned.

05 · Reflection

The project changed debugging from a last step into part of the design. If ownership is unclear when a resource is created, it will be even less clear when an execution path fails.

Project notes.

Margin notes

  • 01

    Curriculum project completed at 42 Lisboa

  • 02

    My focus: execution, signals, and memory cleanup

  • 03

    Repository includes Valgrind and community tester targets

Read the repository or ask me about the project.

View repositoryDiscuss this work