xxii
■INTRODUCTION
Although finding the solution we want is great, it’s not the most efficient use of our
time. To go from having a place to store and organize all of our (and, of course, other
programmers’) gems and having them in a heavily documented form, to writing a book
on the subject was only a short step. Even though it is possible to search online references
quickly for specific code, there were many occasions when I just wanted to pull a book off
my shelf. It’s not always obvious what to search for when you have a specific itch that
needs scratching, so you’re not sure exactly to what search for online.
This is to some extent an expression of my own limitations: my family and friends think
I’m a computer guru, but rest assured, I know better. There are many programmers out
there who are much more adept at shell coding than I am. I mainly intended to collect,
order, and explain code that I have found to be highly useful in my professional experi-
ence as a system administrator, and share that information with others.
Who Should Read This Book
The book is meant for the intermediate shell coder up to the advanced shell-code hacker,
because I don’t explain many basic programming structures. If you’re looking for that
type of book, you should look to the resources mentioned in Appendix C.
This is not to say that the beginner won’t find this book useful; it may work well as a supple-
mentary reference to a more traditional shell-scripting training guide. But there is a difference
between learning English as a second language and learning how to apply sarcasm. This book
is like sarcasm in that example; it assumes some basic shell-code literacy.
I go into great detail about how and why the scripts were written in their present form,
and I include some explanation of how to avoid certain problems. Much of my learning
came from sources heavy in obfuscation and light on clarity, so I tried to be as explicit as
possible, and favored explaining too much rather than too little. You can think of many
chapters I included as shell scripts with extremely detailed commentary.
The book is divided into three parts: “Basic Scripting Techniques,” “System Interaction
and Advanced Techniques,” and “Useful Scripts.” Most chapters serve as stand-alone
discussions, although they may refer to other chapters on some minor points.
Issues and Ideas
I have made every effort to test the code that I included in this book to validate that it
works. With a project of this size, however, even with the number of eyes that have
reviewed it, there may be mistakes. I would like to know about the mistakes as well as, and
more importantly, any other ideas and scripts that could be used for future revisions of
this book. Please drop me a note at rbpeters@peterro.com.