The Wonderful Unix Programming Environment 175
The Wonderful Unix Programming
Environment
The Unix zealots make much of the Unix “programming environment.”
They claim Unix has a rich set of tools that makes programming easier.
Here’s what Kernighan and Mashey have to say about it in their seminal
article, “The Unix Programming Environment:”
One of the most productive aspects of the Unix environment is its
provision of a rich set of small, generally useful programs—tools—
for helping with day-to-day programming tasks. The programs
shown below are among the more useful. We will use them to illus-
trate other points in later sections of the article.
Much of any programmer’s work is merely running these and related
programs. For example,
wc *.c
counts a set of C source files;
grep goto *.c
finds all the GOTOs.
These are “among the most useful”?!?!
Yep. That’s what much of this programmer’s work consists of. In fact,
today I spent so much time counting my C files that I didn’t really have
time to do anything else. I think I’ll go count them again.
Another article in the same issue of IEEE Computer is “The Interlisp Pro-
gramming Environment” by Warren Teitelman and Larry Masinter. Inter-
lisp is a very sophisticated programming environment. In 1981, Interlisp
had tools that in 1994 Unix programmers can only salivate while thinking
about.
wc files Count lines, words, and characters in files.
pr files Print files with headings, multiple
columns, etc.
lpr files Spool files onto line printer.
grep pattern files Print all lines containing pattern.