Lucien Rivière
  • HomeGo to
  • ProfileExperience, skills and CVGo to
  • MethodHow I work, layer by layerGo to
  • ContactSay helloGo to
  • ProjectsEverything I built, filterableGo to
  • CollaboratorsEveryone I built withGo to
  • SignalMapA mobile coverage map of Réunion and Mayotte: click anywhere and see the signal you would get from about 3,100 antennas.Projects
  • ZappyA network survival game in three programs: a C++ server, a 3D viewer and AI players, with LLM role-playing agents as a bonus.Projects
  • MaskGeneratorA small neural network that finds the road lines in a camera image, and a 2D raycast that turns them into lidar-like distances to drive a car.Projects
  • CockerA prototype platform to design an app as a graph of services and deploy it on Kubernetes: sandbox to try it, production to expose it.Projects
  • RaytracerA C++ raytracer where everything (shapes, materials, lights, output) is a plugin, sped up with a BVH, with a live preview window.Projects
  • RoboCarA small real car that drives itself around a track: a camera, a lidar-like view of the road lines, and a model that learned from human driving.Projects
  • CVRIETwo machine-learning studies using only scikit-learn: classifying chest X-rays, and grouping patient testimonies into symptom clusters with no labels.Projects
  • MyTeamsA Teams-like chat in Rust: a multi-client server, a command-line client, a text protocol written as an RFC, and data that survives restarts.Projects
  • ArcadeA retro game console in C++ where games and screens are plug-in libraries: swap the game or the graphics (terminal, SDL, SFML) while it runs.Projects
  • Masked DeliveryA game made in a weekend for Global Game Jam 2026: pick the right mask for each caller, then survive the drive, with penalties that stack up.Projects
  • 42shA Unix shell written in C, tcsh-style: pipes, logic operators, globbing, aliases, variables, line editing and history, checked against Bash.Projects
  • CorewarA virtual machine in C where small programs fight inside a shared memory, with my own warrior and a 3D viewer in the bonus.Projects
  • A-DasHboarDA dashboard of widgets from third-party services, built on JustBetterAuth, an authentication library written from scratch.Projects
  • StoneAnalysisA Python tool that finds the notes in a sound file with a hand-written Fourier transform, and hides secret messages inside the audio.Projects
  • PipetoA security audit of a nuclear-reactor console full of planted vulnerabilities: find them, rank them, patch them and prove the fixes with tests.Projects
  • TardisCleaning SNCF train-delay data, training a model to predict delays, and a Streamlit dashboard. The model barely beat guessing, and the page says so.Projects
  • InterStonarThrow a rock into a simulated universe: planets that attract each other and merge, or shapes it hits, found by stepping with signed distances.Projects
  • SensAIA small chat program for a local AI model that talks to it with plain HTTP, and can force its answers into a JSON shape you define.Projects
  • This portfolioThe site you are on: one set of data, six themes. Each theme is a different way to explore the same work, from a familiar page to a game.Projects
  • Portfolio toysSmall interactive toys from this portfolio: Fourier epicycles, a themed crossword and a bot that walks where you click.Projects
  • snake_pyA contribution to Infamous97440's repository: 2 commits from me.Projects
  • MyTopA clone of the Linux top command in C and ncurses: live CPU, memory, swap and per-process usage read from /proc.Projects
  • Switch to CorporateThemes
  • Switch to SpaceThemes
  • Switch to ReelThemes
  • Switch to GroveThemes
  • Switch to Voxel RedstoneThemes
  • Search the whole siteActions
  • Download CV (PDF)Actions
  • Copy my email addressActions
  • Turn the home page bot on or offActions
All themes

← All projects

42sh

A Unix shell written in C, tcsh-style: pipes, logic operators, globbing, aliases, variables, line editing and history, checked against Bash.

Period
Apr 2025 – May 2025
Role
Globbing, aliases, variables and tests
Team
5 people
Status
archived

Stack and tags

Demo

A real session, recorded in a clean container: builtins (env, alias, repeat, which, where), redirections, pipes, globbing, braces and the error messages. Line-by-line mode: the ncurses line editor needs a real terminal.
Transcript (final screen)
/home/demo/42sh
ls: cannot access 'nowhere': No such file or directory
(15:03) demo@~/42sh[2] $> setenv GREETING hello ; env | grep GREETING
GREETING=hello
(15:03) demo@~/42sh[0] $> unsetenv GREETING ; env | grep GREETING || echo gone
gone
(15:04) demo@~/42sh[0] $> echo one > notes.txt ; echo two >> notes.txt ; cat < notes.txt
one
two
(15:04) demo@~/42sh[0] $> ls src/*/*.c | wc -l ; echo {red,green,blue}
38
red green blue
(15:04) demo@~/42sh[0] $> alias ll "ls -1" ; ll include
llists.h
minishell.h
screen.h
tests.h
(15:04) demo@~/42sh[0] $> repeat 2 echo hi ; which cd ; where ls
hi
hi
cd: shell built-in command.
/usr/bin/ls
/bin/ls
(15:04) demo@~/42sh[0] $> notacommand
notacommand: Command not found.
(15:04) demo@~/42sh[1] $> echo "unclosed
Unmatched '"'.
(15:04) demo@~/42sh[1] $> ls >
Missing name for redirect.
(15:04) demo@~/42sh[1] $> 

A shell is the program you type commands into, and it is a small language of its own: ls *.c | wc -l && echo done is read, expanded and run by it. 42sh is our own, modelled on tcsh, built from scratch in C in about five weeks by a team of five.

How it works

A command line is first turned into a tree: what runs first, what depends on what, where the output goes. Before anything runs, the shell expands it, so *.c becomes the list of matching files and aliases are replaced. It has variables, the usual built-in commands, line editing and history when you type, and it stays quiet and scriptable when it is not talking to a person.

To be sure it behaves like a real shell, the tests run the same commands in 42sh and in Bash and compare the results.

What I took from it

  • Copying a reference implementation’s output is a better test than reading the manual.
  • Turning text into a tree first makes every later feature smaller.

Built with

  • Théo Futol3rd-year student at @Epitech.GitHubLinkedIn
  • Arthur Girardin--CalbeNo bio yet.GitHubLinkedIn
  • LOYER AurélienSecond-year student at Epitech Réunion – Class of @EpitechPGEPromo2029.GitHubWebsiteLinkedIn
  • Joachim IsmaelNo bio yet.