The Unix Programming Environment

Last updated
The Unix Programming Environment
English4.gif
Front cover of The Unix Programming Environment
Author Brian W. Kernighan and Rob Pike
LanguageEnglish
Subject Computer programming
Publisher Prentice Hall
Publication date
1984
ISBN 0-13-937681-X

The Unix Programming Environment, first published in 1984 by Prentice Hall, is a book written by Brian W. Kernighan and Rob Pike, both of Bell Labs and considered an important and early document of the Unix operating system.

Contents

Unix philosophy

The book addresses the Unix philosophy of small cooperating tools with standardized inputs and outputs. Kernighan and Pike gives a brief description of the Unix design and the Unix philosophy: [1]

Even though the UNIX system introduces a number of innovative programs and techniques, no single program or idea makes it work well. Instead, what makes it effective is the approach to programming, a philosophy of using the computer. Although that philosophy can't be written down in a single sentence, at its heart is the idea that the power of a system comes more from the relationships among programs than from the programs themselves. Many UNIX programs do quite trivial things in isolation, but, combined with other programs, become general and useful tools.

The authors further write that their goal for this book is "to communicate the UNIX programming philosophy." [1]

Content and topics

The book starts off with an introduction to Unix for beginners. Next, it goes into the basics of the file system and shell. The reader is led through topics ranging from the use of filters, to how to use C for programming robust Unix applications, and the basics of grep, sed, make, and AWK. The book closes with a tutorial on making a programming language parser with yacc and how to use troff with ms and mm to format documents, the preprocessors tbl, eqn, and pic, and making man pages with the man macro set. The appendices cover the ed editor and the abovementioned programming language, named hoc, which stands for "high-order calculator".

Historical context

Although Unix still exists decades after the publication of this book, the book describes an already mature Unix: In 1984, Unix had already been in development for 15 years (since 1969), it had been published in a peer-reviewed journal 10 years earlier (SOSP, 1974, "The UNIX Timesharing System"), and at least seven official editions of its manuals had been published (see Version 7 Unix). In 1984, several commercial and academic variants of UNIX already existed (e.g., Xenix, SunOS, BSD, UNIX System V, HP-UX), and a year earlier Dennis Ritchie and Ken Thompson won the prestigious Turing Award for their work on UNIX. The book was written not when UNIX was just starting out, but when it was already popular enough to be worthy of a book published for the masses of new users that were coming in.

In retrospect, not only was 1984 not an early stage of Unix's evolution, in some respects it was the end of Unix evolution, at least in Bell Labs: The important UNIX variants had already forked from AT&T's Research Unix earlier: System V was published in 1983, BSD was based on the 1979 Seventh Edition Unix and most commercial Unix variants were based on System V, BSD, or some combination of both. Eighth Edition Unix came out right after this book, and further development of UNIX in Bell Labs (the Ninth and Tenth Edition) never made it outside Bell Labs until their effort evolved into Plan 9 from Bell Labs.

C programming style

The book was written before ANSI C was first drafted; the programs in it follow the older K&R style. However, the source code available on the book's website has been updated for ANSI C conformance.

Critical reception

Technical editor Ben Everard for Linux Voice praised the book for providing relevant documentation despite being 30 years old and for being a good book for an aspiring programmer who does not know much about Linux. [2]

Editions

Notes

  1. 1 2 Kernighan, Brian W.; Pike, Rob (1984). The UNIX Programming Environment. p. viii.
  2. "Linux Voice – Issue 6" (PDF). Linux Voice : The Blog and Podcast for a Very Different Kind of Linux Magazine. Linux Voice. September 2014. p. 52. ISSN   2054-3778.

Related Research Articles

<span class="mw-page-title-main">Brian Kernighan</span> Canadian computer scientist, co-creator of the Unix operating system

Brian Wilson Kernighan is a Canadian computer scientist.

<span class="mw-page-title-main">Dennis Ritchie</span> American computer scientist, co-creator of the Unix operating system

Dennis MacAlistair Ritchie was an American computer scientist. He is best known for creating the C programming language and, with long-time colleague Ken Thompson, the Unix operating system and B programming language. Ritchie and Thompson were awarded the Turing Award from the ACM in 1983, the Hamming Medal from the IEEE in 1990 and the National Medal of Technology from President Bill Clinton in 1999. Ritchie was the head of Lucent Technologies System Software Research Department when he retired in 2007. He was the "R" in K&R C, and commonly known by his username dmr.

<span class="mw-page-title-main">Plan 9 from Bell Labs</span> Distributed operating system

Plan 9 from Bell Labs is a distributed operating system which originated from the Computing Science Research Center (CSRC) at Bell Labs in the mid-1980s and built on UNIX concepts first developed there in the late 1960s. Since 2000, Plan 9 has been free and open-source. The final official release was in early 2015.

troff, short for "typesetter roff", is the major component of a document processing system developed by Bell Labs for the Unix operating system. troff and the related nroff were both developed from the original roff.

Yacc is a computer program for the Unix operating system developed by Stephen C. Johnson. It is a lookahead left-to-right rightmost derivation (LALR) parser generator, generating a LALR parser based on a formal grammar, written in a notation similar to Backus–Naur form (BNF). Yacc is supplied as a standard utility on BSD and AT&T Unix. GNU-based Linux distributions include Bison, a forward-compatible Yacc replacement.

<span class="mw-page-title-main">Bourne shell</span> Command-line interpreter for operating systems

The Bourne shell (sh) is a shell command-line interpreter for computer operating systems.

<span class="mw-page-title-main">Acme (text editor)</span>

Acme is a text editor and graphical shell from the Plan 9 from Bell Labs operating system, designed and implemented by Rob Pike. It can use the Sam command language. The design of the interface was influenced by Oberon. It is different from other editing environments in that it acts as a 9P server. A distinctive element of the user interface is mouse chording.

<span class="mw-page-title-main">Unix philosophy</span> Software development philosophy

The Unix philosophy, originated by Ken Thompson, is a set of cultural norms and philosophical approaches to minimalist, modular software development. It is based on the experience of leading developers of the Unix operating system. Early Unix developers were important in bringing the concepts of modularity and reusability into software engineering practice, spawning a "software tools" movement. Over time, the leading developers of Unix established a set of cultural norms for developing software; these norms became as important and influential as the technology of Unix itself, and have been termed the "Unix philosophy."

The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. Starting from the original ANSI C standard, it was developed at the same time as the C library POSIX specification, which is a superset of it. Since ANSI C was adopted by the International Organization for Standardization, the C standard library is also called the ISO C library.

<i>The C Programming Language</i> Programming book written by Brian Kernighan and Dennis Ritchie

The C Programming Language is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the C programming language, as well as co-designed the Unix operating system with which development of the language was closely intertwined. The book was central to the development and popularization of C and is still widely read and used today. Because the book was co-authored by the original language designer, and because the first edition of the book served for many years as the de facto standard for the language, the book was regarded by many to be the authoritative reference on C.

<i>The Art of Unix Programming</i>

The Art of Unix Programming by Eric S. Raymond is a book about the history and culture of Unix programming from its earliest days in 1969 to 2003 when it was published, covering both genetic derivations such as BSD and conceptual ones such as Linux.

<span class="mw-page-title-main">History of Unix</span>

The history of Unix dates back to the mid-1960s, when the Massachusetts Institute of Technology, AT&T Bell Labs, and General Electric were jointly developing an experimental time-sharing operating system called Multics for the GE-645 mainframe. Multics introduced many innovations, but also had many problems. Bell Labs, frustrated by the size and complexity of Multics but not its aims, slowly pulled out of the project. Their last researchers to leave Multics – among them Ken Thompson, Dennis Ritchie, Doug McIlroy, and Joe Ossanna – decided to redo the work, but on a much smaller scale.

hoc, an acronym for High Order Calculator, is an interpreted programming language that was used in the 1984 book The Unix Programming Environment to demonstrate how to build interpreters using Yacc.

<span class="mw-page-title-main">Berkeley Software Distribution</span> Unix operating system

The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley. The term "BSD" commonly refers to its open-source descendants, including FreeBSD, OpenBSD, NetBSD, and DragonFly BSD.

<span class="mw-page-title-main">Unix-like</span> Operating system that behaves in a manner similar to a Unix system

A Unix-like operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-like application is one that behaves like the corresponding Unix command or shell. Although there are general philosophies for Unix design, there is no technical standard defining the term, and opinions can differ about the degree to which a particular operating system or application is Unix-like.

<span class="mw-page-title-main">Unix</span> Family of computer operating systems

Unix is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and others.

<span class="mw-page-title-main">Ken Thompson</span> American computer scientist, co-creator of the Unix operating system

Kenneth Lane Thompson is an American pioneer of computer science. Thompson worked at Bell Labs for most of his career where he designed and implemented the original Unix operating system. He also invented the B programming language, the direct predecessor to the C programming language, and was one of the creators and early developers of the Plan 9 operating system. Since 2006, Thompson has worked at Google, where he co-developed the Go programming language.

<span class="mw-page-title-main">Unix filesystem</span> Directory structure used by a Unix-like operating system

In Unix and operating systems inspired by it, the file system is considered a central component of the operating system. It was also one of the first parts of the system to be designed and implemented by Ken Thompson in the first experimental version of Unix, dated 1969.

cat (Unix) Unix command utility

cat is a standard Unix utility that reads files sequentially, writing them to standard output. The name is derived from its function to (con)catenate files . It has been ported to a number of operating systems.