Systems · 2026

msh

Minimal Unix shell in C11: pipelines, redirection, heredocs and job control

Complete · source available

Overview

A shell that implements the parts that teach something: fork, exec, wait, file-descriptor plumbing, signals, process groups and terminal ownership. It builds warning-free with strict flags.

Highlights

  • Correct terminal handoff: process groups per pipeline, tcsetpgrp(), WUNTRACED so ^Z shows a stopped job, termios restored after each job.
  • 35 non-interactive assertions including a 40-stage pipeline and fd-leak checks; make asan && make test clean.
  • Scope stated: no &&/||, subshells, functions or command substitution.