Sebastopol, CA--A Swiss Army Knife is a nifty tool--one that proves useful in the most surprising situations--but handy as it is, it can't do everything. "There's only so much you can do with a Swiss Army Knife," Arnold Robbins and Nelson H. F. Beebe explain in their preface to Classic Shell Scripting (O'Reilly, US $34.95). "While it might be great for whittling or simple carving, you wouldn't want to use it, for example, to build a doghouse or a bird feeder. Instead, you would move on to using specialized tools, such as a hammer, saw, clamp, or planer. So, too, when solving programming problems, it's better to use specialized software tools."
Experienced Unix developers and administrators have used this long-standing analogy to illustrate the "software tools philosophy," an approach first popularized by the book Software Tools (Addison-Wesley) nearly thirty years ago. In the ensuing decades, Unix systems and the tools used with them have changed, while the philosophy remains as meaningful as ever. "My coauthor and I felt that many of the original Software Tools principles, practices, and techniques--the Unix 'mindset,' so to speak--popularized by the early Unix books were becoming unknown to the current generation of Unix and Linux developers," explains Robbins. "We felt that a modern treatment of these ideas would have a lot of value."
New Unix users and programmers are often bewildered by the variety of tools they find themselves faced with, leading to questions such as "What purpose do they serve?" and "How do I use them?" As Robbins and Beebe demonstrate, these tools are the key to unlocking the real potential of Unix. They call it the "art of shell scripting"--that is, combining Unix tools with the standard shell to get a job done. Shell scripting is not just knowledge of the shell language, but also an understanding of the individual Unix programs: why each one is there, and how to use them by themselves and in combination with other programs.
Robbins notes that the idea of shell scripting seems increasingly foreign to the new wave of Unix users, which is ultimately to their disadvantage: "There is a rush in the Linux and Unix worlds to hide the command line away and do everything with graphical interfaces," he observes. "This is a shame: the underlying power of the shell and the Unix utilities enable many things that just can't be done from a predefined, monolithic, unprogrammable GUI. The differences and capabilities of Unix and Linux systems are what distinguish them from the monopolistic market leader. These abilities should be celebrated, publicized, and learned, not hidden away."
Classic Shell Scripting introduces readers to the common tools that come with a Unix or Linux system, and shows them how to combine the tools with the shell programming language. Readers will learn:
To Robbins, shell scripting is a critical skill for anyone who runs Unix systems or develops software on them. "That includes Linux, the BSDs, and Mac OS X," he says. "The climb up the learning curve is worth the trouble."
In his foreword to the book, Henry Spencer of SP Systems laments the conspicuous lack of a good book on shell scripting, but reassures readers that, "Here, at last, is an up-to-date and painless introduction to the first and best of the Unix scripting languages. It's illustrated with realistic examples that make useful tools in their own right. It covers the standard Unix tools well enough to get people started with them (and to make a useful reference for those who find the manual pages a bit forbidding)." Spencer adds, "I recommend this book to anyone doing shell scripting or administering Unix-derived systems. I learned things from it; I think you will too."
- Chapter 5, "Pipelines Can Do Amazing Things"
- More information about the book, including table of contents, index, author bios, and samples
- A cover graphic in JPEG format
Classic Shell Scripting
Arnold Robbins and Nelson H. F. Beebe
ISBN: 0-596-00595-4, 534 pages, $34.95 US, $48.95 CA
O’Reilly Media spreads the knowledge of innovators through its books, online services, magazines, and conferences. Since 1978, O’Reilly Media has been a chronicler and catalyst of cutting-edge development, homing in on the technology trends that really matter and spurring their adoption by amplifying “faint signals” from the alpha geeks who are creating the future. An active participant in the technology community, the company has a long history of advocacy, meme-making, and evangelism.