From: utzoo!decvax!harpo!utah-cs!utah-gr!thomas Newsgroups: net.unix-wizards,net.books Title: Bourne Unix book Article-I.D.: utah-gr.749 Posted: Sat Mar 26 20:05:22 1983 Received: Mon Mar 28 01:13:46 1983 "Review" of *The UNIX System* by S.R. Bourne. (Addison Wesley, The International computer science series, 1982, ISBN 0-201-13791-7) S Bourne is probably best known in the Unix community as being the author of the "Bourne Shell", the standard shell supplied with Unix systems from V7 on. He has recently published a book about the Unix system that is the best introductory book on the subject that I have seen yet. The book begins with a short introductory section describing the history of the Unix system, the "programming environment", and "UNIX system concepts". This is followed by a "Getting Started" chapter which is similar to the document of the same name in the Unix programmers manual, although he has tried to point out the ways in which a particular Unix system may vary from his description. (For example, the discussion of the terminal erase and kill characters mentions that these may differ from the "standard" # and @.) The remaining chapters are each dedicated to a single subject: editing, the shell, C, writing programs, document preparation, and data manipulation tool such as awk, sed, sort and their friends. There are also several appendices containing many manual pages from the UPM; summaries of adb, ed, sh, troff, and vi; a sample troff macro library; a summary of the -ms macro library; and the ASCII character set. The book is well written and very readable. There are numerous examples illustrating the text. He does not use the "sample dialogue" form of example that many authors seem to prefer, but usually shows a sample command and describes the results. This may be harder for some readers to follow, but is the only way to describe interactions with programs such as the vi editor. As one might expect, there is a detailed description of the shell. Simple shell usage is discussed in the "Getting Started" chapter, covering pipes and filter, file name expansion, quoting, prompts, and the .profile file. Chapter 4 "The Shell" discusses in detail shell procedures and advanced use. The only nit I have to pick here is that the "alternate" shell (i.e, the C-shell) preferred by many of us is not even mentioned anywhere in the book. This is a disadvantage locally, since all users get csh as their default login shell. The C language chapter provides an introduction to the C language via the typical "first" program: main() { printf("It works.\n"); } but proceeds rapidly from there. The sample programs are printed in their entirety, then followed with a line-by-line annotated description of the program function. Given the discussion in net.lang.c about evaluation order, the statement that "n++ >= 10 Compares the value of n with 10 ... 1 is added to n after its value has been used in the comparison" might be a little overcomplicated, but is probably a justifiable simplification. The section of the chapter devoted to the language itself ends with a list of "programming maxims" with which almost no one could disagree including "Run the lint command and understand its output". The next section describes the commands associated with compiling a C program, the cc command, make, lint, and libraries. The chapter concludes with "Debugging a C program" which concentrates on the use of adb, since it is more widely available. A short discussion of sdb would not have been amiss here. Chapter 6, "UNIX System Programming", is devoted mostly to describing the interaction between a C program and the Unix system. He covers argument processing, input/output, the file system, terminal i/o, pipes, processes and signals. There is a short description of stdio in the C chapter, but it seems to be mostly ignored here. Since most Unix programs seem to spend much of their life pushing characters in and out of files, it probably would have been appropriate to dedicate a section to it. I am not qualified to review the chapter on document preparation, since my use of nroff and troff is confined to writing manual pages, but it is one of the longest chapters in the book, and covers not only n/troff, but such auxiliary tools as diction, eqn, ptx, refer, spell, style and tbl. The final chapter describes the use of the "Data Manipulation Tools" awk, cmp, comm, diff, grep, join, sed, sort, tail, tr, uniq, field, and lex and yacc. This chapter contains a long example of a "tennis ladder system" built out of shell scripts, and awk programs. A motivated reader should be able to become a knowledgeable user of the Unix system by reading and understanding this book. Little supplementary material should be needed, since the appendices contain most of the Unix programmers manual.