Rating: - Book Review: Classic Shell Scripting
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
[...]
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! :) 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.
Rating: - Carl's review
Although I have just started reading through the book, what I see so far is interesting. I'm looking forward to writing my own scripts. With this book I feel confident I will be able to.
I was a bit surprised that C shell is not included.
Rating: - Invaluable resource for shell scripters
This is the book that I have been waiting for years for. It's classic O'Reilly, but it's better than that. Even the O'Reilly books have fallen short of being truly useful for shell scripting. I think this was primarily because the authors have been thinking more about language fundamentals then about teaching useful things. This book is targeted towards teaching shell scripting through practical application. This is the shell scripting book to get.
Rating: - A really fine book
I found this book to be useful, accurate, well-written and
well-organized. The code examples are lucid and clear.
I've written a longer review for (...), but
all you need to know is that I consider this an excellent
piece of work.
Rating: - This might be a great second book on shell scripting.
This might be a great second book on shell scripting. Can serve as a valuable add on to "Learning Korn shell" from O'Reilly -- also a very strong book on shell scripting.
The authors provide a lot of interesting and useful information that is difficult to find in other books. They devoted Ch 5 to piping and in 5.4 "Word List" they discuss famous Doug McIlroy alternative solution to Donald Knuth program of creating the list of the n most-frequent words, with counts of their frequency of occurrence, sorted by descending count from an arbitrary text file.
The authors discuss many Unix tools that are used with shell (Unix toolbox). They provide a very good (but too brief) discussion of grep and find. Discussion of xargs (which is usually a sign on a good book on scripting) includes /dev/null trick, but unfortunately they do not mention an option -0n with which this trick makes the most sense.
One of the best chapters of the book is Ch. 13 devoted to process control. Also good is Chapter 11 that provides a solution to pretty complex and practically important for many system administrators task of merging passwd files in Unix. It provides a perfect insight into solving real sysadmins problems using AWK and shell.
Shortcomings are few. in "5.2. Structured Data for the Web" the authors should probably use AWK instead of SED. Also XML processing generally requires using a lexical analyzer, not regular expressions. Therefore a tag list example would be better converted to something simpler, for example generating C-tags for vi.
|