Linux Shell Scripting

I just finished “Linux Shell Scripting Cookbook” (Second Edition) by Shantanu Tushar and Sarath Lakshman. This is a beginner’s guide to using shell scripting (bash) on linux.

Screen Shot 2013-10-07 at 8.25.59 AMUsually, a “cookbook” is set up more like a series of projects organized around a set of themes, and is usually less introductory than this book. “Linux Shell Scripting Cookbook” might be better titled “Introduction to Linux Shell Scripting” because it is more like a tutorial and a how too book than like a cookbook. Nonetheless, it is an excellent tutorial that includes over 100 “recipes” that address a diversity of applications. It’s just that they are organized more like a tutorial. What this means is that a beginner can use only the resources in this book and get results. The various recipes are organized in an order that brings the reader through basics (like how to use the terminal, how to mess with environment variables, etc.) then on to more complex topics such as regular expressions, manipulating text, accessing web pages, and archiving. One very nice set of scripts that is not often found in intro books addresses networking. The book also covers MySQL database use.

All of the scripts are available from the publisher in a well organized zip archive.

I read the e-version of the book, in iBooks, but the PDF version is very nice as well. I don’t know how this would translate as at Kindle book. But, importantly (and this may be more common now than not) the ebook uses all text, unlike some earlier versions of ebooks that used photographs of key text snippets as graphics which essentially renders them useless. Of course, copy and paste from a ebook is difficult, and that is where the zip file of scrips comes in. You can open the PDF file, get the zip archive, and as you read through examples simply open up (or copy and paste) the scripts from the zip archive and modify or run them. Also, the ebook is cheaper than a paper edition and clearly takes up way less space!

If I was going to recommend a starting out guide to shell scripting this is the book I’d recommend right now. It is well organized and well executed.

I do have a small rant that applies to virtually ALL tech-related books I’ve seen. There is an old tradition in *nix style documentation of putting certain information in the front matter. Books always have front matter, of course, but computer documents tend to have more front matter than usual. A typical example is this reference resource for Debian:

Screen Shot 2013-10-07 at 8.20.29 AM

Notice all that stuff in the beginning. Like anybody reads any of that, especially the “conventions” section. Proper typography in a code-rich book does not have to be explained in detail. You can see what is code, what are comments, etc. etc. Most of this information should be added as an appendix at the end of the book where it is out of the way and can be ignored.

On a web page like the one shown here all you have to do is scan down, but in a book you have to leaf (virtually or meatspacelly) past all that stuff to get to the actual book contents. The Linux Shell Scripting book being discussed here has the first actual text on actual page 25 or so (though it is numbered page 8). I recommend moving as much of this front matter as possible to the back.

But that is a general rant about all books of this sort, which I happen to think of while reviewing this book.

“Linux Shell Scripting Cookbook” is available at Packt Publishing.

Other Linux related posts are HERE

Other book reviews are HERE

Comments

  1. #1 roger
    http://www.knifeup.com
    October 7, 2013

    I read this book (vol 1) back when I was in high school and tinkering with Ubuntu. Great book and BaSH is a beautiful language, ver worth learning.

  2. […] See the original post: Linux Shell Scripting – Greg Laden's Blog – ScienceBlogs […]