blog dds

2017.11.19

Reviving the 1973 Unix Programmer's Manual

The 1973 Fourth Edition of the Unix Programmer's Manual doesn't seem to be available online in typeset form. This is how I managed to recreate it from its source code.

The manual pages and tools for building the manual were unearthed by the late Dennis Ritchie, and made available through the The Unix Heritage Society on January 2000. The consist of two shell scripts and about 14,121 lines of troff markup text. I modernized the old shell scripts and corrected some minor markup glitches through commits that are recorded in a GitHub repository.

The process of working with 44-year artefacts was surprisingly smooth. The scripts for generating the table of contents and the permuted index are based on the original ones. The changes I did in the scripts involved the following.

  • I changed a shell script's goto statements into a case statement
  • I modified instances of ed directly receiving standard input, to use a here document
  • I fixed an ed substitution command to what, I assume, is its modern equivalent
  • I adjusted the invocation of the permuted index (ptx) and troff tools
  • I fixed the four-column output of the modern ptx to generate two columns

Most of the troff markup text compiled without a hitch. The few problems I encountered had to do with

  • missing spaces after requests,
  • the ^F hyphenation character causing groff to complain,
  • a failure of groff to honor .li (literal) requests followed by a line starting with a ., and
  • two uses of a lowercase letter for specifying a font.

I wrote from scratch a script to typeset everything into one volume. I could not find a shell script for typesetting the whole manual in any of the Research Editions. I assume the process of running the typesetter was so cumbersome, error prone, and time-consuming that it was manually performed on a page-by-page basis.

Here you can find the manual in PDF format. As is the case with all the original Unix documentation, its quality in terms of conciseness, completeness, and rigour remains unsurpassed until today. If you search, you can even find nuggets of humour, as in the Bugs section of the tmheader - Technical Memorandum cover sheet command: God help you on two-page abstracts. Try to write less.

Read and post comments, or share through   


Creative Commons License Last modified: Sunday, November 19, 2017 2:36 pm
Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-Share Alike 3.0 Greece License.