UNIX Shells by Example Third Edition is your complete, step-by-step guide to all five essential UNIX shells - bash, tcsh, C, Bourne, and Korn - and all three essential UNIX shell programming utilities, awk, sed and grep. This new Third Edition is better than ever, with hundreds of completely updated, classroom-proven examples from Silicon Valley's top UNIX and Linux instructor, Ellie Quigley. Starting with the basics, Quigley gets you all the way to expert-level techniques. Along the way, you'll learn what UNIX shells are, what they do, and how they integrate with other UNIX utilities and processes. You'll master creating, running, and debugging shell scripts; using grep, egrep and ggrep; working with sed, and much more. This edition contains extensive new coverage of bash and tcsh, as well as hundreds of updated and classroom-tested examples for all five leading shells. It contains hands-on exercises for every topic, an appendix with detailed syntax listings, comparison charts, and much more. For all UNIX system administrators, application developers, and power users.
I came to this book because a new job had moved me from a situation where the people I worked with generally knew what the POSIX standards were, and used Bash (the GNU Bourne-Again Shell) as their default shell (because it is, on most GNU/Linux distributions), to a place where tcsh was the default login shell, but most scripts were written in non-POSIX-compliant sh, with Bashisms and Kornisms all over the place but unacknowledged as such.
Since I saw much cleanup and pedantic explanation of shell differences in my future, I elected to bone up and ensure I had a command of the territory I was entering. I already had many years of POSIX and Bash scripting experience under my belt (and more importantly, I knew the difference). I had used tcsh as well, from 1993 to 1999 or so, and for a time I wrote scripts in sh while continuing to use tcsh as my interactive shell, but eventually succumbed to the lure of a consistent environment.
My bottom line on this title is "adequate"; it does what it sets out to do, which is walk through the features of several shells: historical Bourne (i.e., Solaris's /bin/sh, not fully POSIX-compliant), csh, ksh (some mention of the differences between original ksh, ksh88, and ksh93 is made, but there's no comprehensive breakdown of the differences), bash (2.x was the latest as of this writing), and tcsh.
Appendix B has a sort of comparison/translation table between csh/tcsh, (traditional) sh, ksh, and bash--this is fairly useful.
The examples are sometimes more contrived than practical, and usually duplicated between the chapters as much as possible (which isn't necessarily a bad thing, just worth noting).
Three early chapters cover grep, sed, and awk in a useful but somewhat perfunctory manner. Appendix A similarly breezes through the usual suite of Unix commands that just about every other introductory Unix books covers in the same manner.
Appendix C, a few pages on shell quoting, is very good. Anyone who knows just enough shell syntax to be dangerous should read those pages first, and make sure they've mastered them.
As noted above, there is a fourth edition available now. I presume it covers vesion 3 of bash, and I would avoid that edition if it doesn't.
If I were in charge of writing a new edition of this book, I would:
* Eliminate the coverage of grep, probably in favor of Mastering Regular Expressions by O'Reilly, if people want depth, and a reference card if they don't.
* Eliminate the coverage of sed and awk in favor of O'Reilly's sed & awk.That title fully explores those utilities. A little bit of knowledge of these tools (as presented here) does more harm than good, I fear. I see ignorant stuff like:
* The only widespread system that still ships a pre-POSIX /bin/sh is Solaris. Cover Solaris sh as such, a historical relic, with footnotes to a chapter on POSIX sh.
* Talk about the POSIX.2 standard much, much more.
* Emphasize that csh and tcsh are very poor choices for scripting languages. For example, there is literally no syntax in those shells for redirecting output to standard error, and only standard error. This means that people writing csh/tcsh scripts are likely to write diagnostic messages to standard output instead, which makes them more like MS-DOS batch files running on Unix rather than proper Unix shell scripts.
* Either state at the outset than only one version of a shell (original ksh, ksh88, ksh93, pdksh, for example) will be covered, or be much more scrupulous about documenting which features are and are not available in each version. Same goes for bash 1/2/3.
* Give some coverage to zsh, for crying out loud. It's got enough users to merit some attention, even if it's got so many features one could write a 1000 page back on it alone. As part of the abbreviated coverage, be frank about what is not covered.
I did not remove the CD-ROM from its packaging, and never at any point saw any reason to do so. The disc would seem to just drive up the production cost (and possibly justify goosing the profit margin to "offset" that cost; the back cover claims that the disc contains "the source code and data files for all examples in the book", which is not really an added value given the nature of those examples, which are usually short enough to be typed in in less time than I imagine it would take to pop the disc into a drive and navigate to the file in question. A CD-ROM is much more justified in titles like No Starch Press's "Wicked Cool $FOO Scripts" series and O'Reilly's "$FOO Cookbook" series.
It is thorough but extremely repetitive. Mistakes from earlier editions were still uncorrected in the latest edition. Still, it will definitely allow you to get your head around Regular Expressions and the various text search and manipulation tools available on Unix-like systems.