In an old video from Bell Labs, Brian Kernighan introduces the audience to the concept of pipelines in UNIX systems using a simple spell checking example:
Most of the programs used in the spell checking example are not present in modern UNIX variants. For fun I wanted to see how easy it would be to recreate the same capabilities today.
The example operates on a text file called
sentence
:
At Bell Laborotories
UNIX systems privide
more timesharing ports
than all other systems
combined
The original chain of commands used in the video are:
makewords sentence | lowercase | sort | unique | mismatch
Only the sort
program still exists today. And the unique
program
have been renamed to uniq
on most systems.
This means we need to re-create makewords
, lowercase
and mismatch
.
This repository contains those 3 programs.
To run them locally, simply clone this reporsitory and run the following pipeline:
./makewords sentence | ./lowercase | sort | uniq | ./mismatch
The output of this command is:
laborotories
ports
privide
systems
timesharing
unix
For more awesome old videos of computer history, check out Awesome Computer History.
To the extent possible under law, Thomas Watson has waived all copyright and related or neighboring rights to this work.