View Review Details


Book:   Classic Shell Scripting
Subject:   Book Review: Classic Shell Scripting
Date:   2005-09-09 11:10:38
From:   Dan Clough
Rating:  StarStarStarStarStar

Classic Shell Scripting
Hidden Commands that Unlock the Power of Unix
By Arnold Robbins, Nelson H.F. Beebe
First Edition May 2005
ISBN: 0-596-00595-4
558 pages, $34.95
http://www.oreilly.com/catalog/shellsrptg/


I found this to be quite a useful book for learning more about Unix/Linux shell scripting. I would consider this one to be an intermediate level text, and complete beginners might be better served by a more simplified book. There are quite a bit of in-depth details included, and many very nice examples and code snippets. Like all O’Reilly books, it is well organized and formatted, and clearly written.


The book opens with a brief history of Unix and how important the shell (and scripting) is to it. There are some comparisons with other programming languages, and why it is sometimes preferable to use a script versus a compiled program. The very basics of how scripts are written and used are also mentioned here, and beginners may want to refer to an additional book for more of the basic instructions.


The next few chapters cover mostly text processing with scripts, including searching, sorting, printing, extracting, and counting methods. Good examples are used, including the use of regular expressions and pipes to increase the power of your scripts. Following this, there are several chapters on more advanced scripting, including how to use variables, loops, functions, standard I/O, redirection, wildcards, using “awk”, and working with external files. Extensive example code is provided throughout.


The remaining chapters of the book get into more advanced subjects such as database manipulation, process control, and increasing the security of scripts. Portability and shells other than bash are also discussed.


Perhaps the most interesting part of the book (for me) were the Appendices and other sections at the end. Appendix A is entitled “Writing Manual Pages”, and is extremely informative on how to produce and format a valid man page. This is a much more complicated process than I had previously known (can you say “groff”?), and is quite interesting. For anyone who has ever complained about a poor man page, this will give you all the tools you need to write an improved version! J Appendix B has some excellent in-depth discussion about Unix files and filesystems, including attributes and permissions. Appendix C is a summary of important Unix commands for shell scripting, categorized by function, which is a good quick reference list. Following this, there is an excellent Bibliography that recommends related books for further reading. Finally, there is good Glossary and an Index.


Overall, I found the book to be excellent in it’s content and quality. I would recommend that a beginner also find a companion book to more gently introduce the fundamentals of shells and scripting, but this volume is excellent for the intermediate to advanced user. If you want to fully use the power of the Unix/Linux shell, this is a “must-have” book! Well done to the authors and O’Reilly Publishing.