Linux and the Unix Philosophy
Mike Gancarz
Digital Press An imprint of Elsevier Science
Amsterdam Boston Heidelberg London New York Oxford Paris San Diego San Francisco Singapore Sydney Tokyo
Copyright 2003 Elsevier Science (USA)
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher.
Recognizing the importance of preserving what has been written, Elsevier Science prints its books on acid-free paper whenever possible.
Library of Congress Cataloging-in-Publication Data
Gancarz, Mike. Linux and the Unix philosophy / Mike Gancarz. p. cm. Includes bibliographical references and index.
ISBN: 1-55558-273-7(pbk.: alk. paper)
1. Linux. 2. UNIX (Computer file) 3. Operating systems (Computers) I. Title.
QA76.76.O63G364 2003
005.4'3dc21 2003051482
British Library Cataloguing-in-Publication Data
A catalogue record for this book is available from the British Library.
The publisher offers special discounts on bulk orders of this book. For information, please contact:
Manager of Special Sales
Elsevier Science
225 Wildwood Avenue
Woburn, MA 01801-2041
Tel: 781-904-2500
Fax: 781-904-2620
For information on all Digital Press publications available, contact our World Wide Web home page at: http://www.bh.com/digitalpress
10 9 8 7 6 5 4 3 2 1
Printed in the United States of America
Every book should have a dedication.
This book is dedicated to the early adopters of Linux everywhere. You go, gang!
MG
About the Author
Mike Gancarz is an applications and programming consultant in Atlanta, Georgia. Using Linux, Unix, and Java tools, his team develops award-winning imaging solutions for the financial services industry.
An expert in Unix application design, Mike has been an advocate of the Unix approach for more than twenty years. As a member of the team that gave birth to the X Window System, he wrote uwm, the first customizable window manager for X. Although uwm has long been put out to pasture, the usability concepts he pioneered are still found in modern window managers running on Linux today.
While working at Digital Equipment Corporation's Unix Engineering Group in Nashua, New Hampshire, Mike became intimately familiar with the Unix command set in leading the port of the Unix commands and utilities to the 64-bit Alpha processor. His other efforts at Digital led to the development of COMET, a high-performance text retrieval system. Written in the Unix shell language, COMET revolutionized technical support at Digital by indexing most of the company's internal documentation and source code, making instant answers available to Digital's support staff around the world.
Later Mike turned to independent consulting on web development projects in the Atlanta area. His clients have included IBM, Sprint, Worldcom, and various financial services firms.
Mike resides in a northern Atlanta suburb with his wife, two children, and the world's most adorable chihuahua. When he's not tinkering with Linux, he enjoys long games of Civilization and an occasional game of chess.
Acknowledgments
The birth of a book is like the birth of a child: every one is different. The writing and publication of my first book, The UNIX Philosophy, had gone fairly smoothly as books go. Had I known that I would have faced so much personal turmoil during the writing of this second book, I would not likely have signed the publishing contract. I would have thought twice before getting involved in this project.
Having endured the personal turmoil amidst the writing and publishing process, I admit that this book is a sort of catharsis then, both personally and philosophically. So I must give credit to the great God Almighty for getting me through this process once again. He first and foremost deserves the credit for creating me to do such a work as this.
Kudos go to Pam Chester, acquisitions editor at Digital Press, an imprint of Butterworth-Heinemann, for selling me on the need to do this new edition and then persevering when it had every appearance of becoming another prepublication casualty. Thanks also go to her boss, Theron Shreve, for having the patience to allow the book to come to its full fruition.
I was fortunate to have an awesome crew of developmental reviewers for this edition. Thanks go to Jim Lieb, Scott Morris, Rob Lembree, and Jes Sorensen for their thoughtful insights. Their responses helped me see things in different ways and added much interesting depth to the book. They also provided much-needed encouragement on the home stretch.
Not only does Jon "maddog" Hall deserve special mention for providing an insightful foreword to this book, his efforts at Unix and Linux advocacy are a model for all of us. Few can match his tireless efforts at bringing the message of the Unix way to so many people.
Thanks also go to Phil Sutherland, formerly of Digital Press, for the email exchanges we'd had on the original book idea. Even though it didn't turn out quite the way that either of us expected, he can take heart that his efforts to convince me to write this were not in vain. Some things just take a little longer than others.
Having an author in a household means that everyone learns what it's like to live with a writer. Thank you, Sarah, for all that typing, as boring as it must have been for you. Adam, it's paintball time. I am deeply grateful for the sacrifice you made. And, most importantly, thanks go to my wife Viv for supporting me throughout the writing of this book. Your "Honey-Do" list must be a mile long by now.
Foreword
For me, three major events happened in 1969:
As a student in a major eastern university I had stumbled on a new and fascinating business of writing software for computers. In those days there was no such thing as going down to your local computer store and buying a shrink-wrapped box of software off the shelf. In fact, with the average computer having less than four thousand words of memory, a processor measured in millions of instructions per minute instead of billions of instructions per second, and costing hundreds of thousands of dollars to buy, software was written to make maximum use of the machine's power. Software was written from scratch, with the customer defining the inputs they could supply and the outputs that were desired. The software team (whether in-house or consultants) were then responsible for writing the software that made the transition. If the software did not work, the writers were not paid. Obviously, like any tailor-made item, the software cost a lot of money, but so did the hardware.
Fortunately for me, the Digital Equipment Corporation User Society (DECUS) had a library where people could contribute programs that they had written so that other people could use them. Authors of programs would submit their code to the DECUS library, and the library would then put out a catalog of useful programs, with the cost of copying and mailing by postal mail paid for by the person requesting a copy of the program. The software was free, the distribution (and the costs of printing the catalog, etc.) were not.
Through DECUS I got a lot of free software that I could use. This was good, since as a student I did not have much money to buy tailored software. It was either the software or beer, and the five dollars I would spend in 1969 for copying a text editor would be equivalent to ten pitchers of beer. Imagine how thin I would have been to try and purchase "commercial" software.