• List Price: CDN$ 51.86
  • You Save: CDN$ 15.31 (30%)
In Stock.
Ships from and sold by Amazon.ca. Gift-wrap available.
Shell Scripting Recipes: ... has been added to your Cart
+ CDN$ 6.49 shipping
Used: Acceptable | Details
Condition: Used: Acceptable
Comment: Ships from the USA. Please allow 14-21 business days for delivery. Free State Books. Never settle for less.
Have one to sell?
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See all 2 images

Shell Scripting Recipes: A Problem-Solution Approach Paperback – Aug 24 2006

See all 2 formats and editions Hide other formats and editions
Amazon Price
New from Used from
"Please retry"
CDN$ 36.55
CDN$ 34.35 CDN$ 18.05

Harry Potter and the Cursed Child
click to open popover

No Kindle device required. Download one of the Free Kindle apps to start reading Kindle books on your smartphone, tablet, and computer.
Getting the download link through email is temporarily not available. Please check back later.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your mobile phone number.

Product Details

  • Paperback: 448 pages
  • Publisher: Apress; 1 edition (May 9 2005)
  • Language: English
  • ISBN-10: 1590594711
  • ISBN-13: 978-1590594711
  • Product Dimensions: 19.1 x 2.6 x 23.5 cm
  • Shipping Weight: 953 g
  • Average Customer Review: Be the first to review this item
  • Amazon Bestsellers Rank: #1,107,652 in Books (See Top 100 in Books)
  •  Would you like to update product info, give feedback on images, or tell us about a lower price?

  • See Complete Table of Contents

Product Description

About the Author

Chris F.A. Johnson was introduced to Unix in 1990, and learned shell scripting because there was no C compiler on the system. His first major project was a menu-driven, user-extensible database system with report generator. Johnson constantly writes scripts to automate system administration tasks, and his recent shell projects have included a member database, menuing system, and POP3 mail filtering and retrieval. When not pushing shell scripting to the limit, Johnson teaches chess and composes cryptic crosswords.

Customer Reviews

There are no customer reviews yet on Amazon.ca
5 star
4 star
3 star
2 star
1 star

Most Helpful Customer Reviews on Amazon.com (beta)

Amazon.com: HASH(0x9ecf3f48) out of 5 stars 9 reviews
16 of 16 people found the following review helpful
HASH(0xa00543c0) out of 5 stars My Shell is a Programming Language? Oct. 3 2005
By Raymond Brigleb - Published on Amazon.com
Format: Paperback
This book was kind of an epiphany for me. I've been writing shell scripts for nearly as long as I've been writing programs, but I've always drawn a mental distinction between the two. There was programming, and then there was scripting.

After coding in languages like Perl and then Ruby, the distinction has become increasingly blurred. Many of my "scripts" have proven far, far more useful than anything I've written in a "proper" programming language! They back up my servers, they keep me informed of problems, they've saved me a minute here, a minute there, for perhaps ten years now! So what, really, is the distinction?

I think, to some extent, a shell script is ultimately just limited by a lack of any libraries of code. It lends itself well to simple tasks, but if you do anything even moderately complex, you have to stop and switch to Perl or Ruby. But now Mr. Johnson has written a book that more or less creates a library in your shell script. And the tasks he writes about are so incredibly common, and his recipes so well organized, that you can just flip to a chapter like "Backing Up the Drive" or "Good Housekeeping," and find a dozen solutions to questions you're guaranteed to run into when writing your shell scripts. This book also does an excellent job of showing examples that rely on as few external programs as possible - making them perfectly portable.

This is the most useful book on shell scripting out there, and I wish I could have picked it up ten years ago. If I had, it would still be on my shelf today.
19 of 20 people found the following review helpful
HASH(0xa06f930c) out of 5 stars Unleash the power of the shell Nov. 27 2005
By jose_monkey_org - Published on Amazon.com
Format: Paperback
While the Bourne shell is listed as a full fledged programming language, few people use it like that. Some of it is that they prefer more commonly acknowledged languages like Perl, Python or the like. However, with a book like Shell Scripting Recipes: A Problem-Solution Approach, they'll want to thin twice about it.

I remember my first forays into shell scripting. I didn't want to learn Perl (then the clearly dominant scripting language), and worked hard to learn shell, awk, and sed so that I could do the things I needed to do and automate as much as possible. It paid off, and even impressed a few die hard Perl fans. Less code to do simple tasks, faster to write, and always present. While I don't do nearly as much shell scripting as I used to, I still enjoy seeing someone do neat things in /bin/sh, ksh, or bash.

Chris Johnson's book is in the traditional line of a reference book, much like the O'Reilly cookbook series or, more accurately, the old tome, UNIX Power Tools. It's got a couple of non-recipe chapters, and the rest of it is a lot of fun, useful shell scripting.

Chapter 1 is an invaluable reference to large portions of the POSIX shell language. Johnson covers things like built in commands and program flow, special variables, and variable expansion. He also clearly covers the differences between the Bourne shell and the POSIX shell where they differ. If you're worried, using Bash will almost always work with the examples, I think.

At this point it's easy to think, "I can call out to external commands for a good chunk of the functions he develops." You can, but Johnson makes a compelling argument that shows the impact of a fraction of a second can add up quickly in loops. At this point, you're either agreeing with him and seeing the joy of a direct language like shell or you soon will.

Chapter 20 is a small set of recipes but they serve a different function, namely helping you manage all of these new shell scripts and functions. You can copy, instantiate new shell scripts more easily (by automating the redundant bits), or package them up with simple scripts. Handy tools, and a decent approach.

The recipes run the gamut from the simple to the uncommon, but they all illustrate how do accomplish useful tasks in a shell script. They include file conversion (DOS, UNIX, and Mac), string handling bits, filename management, complex date calculations, screen control capabilities, and even HTML processing. Some of my favorite recipes include the Postscript generation tools (!) and the database management tools. While some people have done these in shell scripts, I've usually seen them done using sloppy or confusing approaches. Johnson's code is clear, direct, and applicable.

That's probably the biggest strength to the book, Johnson's clear writing and examples. Some programming and scripting books try and show you neat tools to accomplish a task, but they don't do a good job of showing you how to translate it to your specific task. In Shell Scripting Recipes, Johnson chooses his code carefully, articulates how it works, and continually builds on a theme. If you pick a few scripts and study them, you'll see tips and tools you can use in your own shell scripts. He also has nicely abstracted scripts that let you recycle his functions in your own scripts with ease.

Overall I quite like Shell Scripting Recipes, I think that while it's easy to think less of the Bourne shell as a language, Johnson has done a good job of writing a concise set of examples, usable code, and in a format that is continually useful and clear. If you've been thinking about improving your shell prowess, this is the book for you.
13 of 15 people found the following review helpful
HASH(0x9ea5daf8) out of 5 stars Handy Shell Guide for Unix/Linux Users July 9 2005
By Robert Stinnett - Published on Amazon.com
Format: Paperback
Shell Scripting Recipes provides the reader with a handy reference for shell tasks that range from the common (how do I extract a portion of a string?) to the complex but sometimes entertaining (find words that fit together on a grid aka make your own crossword). The author does a great job in his layout by presenting the problem, listing the solution and then explaining how it works. The script solutions and examples are broken down by topic and each chapter is indexed on the side of the book for easy reference by the reader.

The book was written for those who have had some Unix/Linux experience under their belt and now want to explore some of the power of the shell itself. Seasoned BASH shell users know that one of the most powerful aspects of the system is the ability to create applications that perform necessary tasks or functions just by using shell scripting. This book would be ideal for anyone who wants to get more out of their system that just using the GUI-interface that has become so common.

Most of all, it covers a lot of problems that occur everyday and that we sometime spend hours looking for a solution for. Things such as removing excess linefeeds from a file, reformatting text, retrieving data automatically and other related tasks -- things that shell scripting excels at providing a mechanism to solve.

Not for the beginner, but a must-have for the experienced Unix (particularly BASH shell) user.
4 of 4 people found the following review helpful
HASH(0x9e9f3858) out of 5 stars Great resource for Bourne-type shell scripting June 25 2005
By Harold McFarland - Published on Amazon.com
Format: Paperback
If you are using a Bourne-type shell, and BASH in particular then you will find a lot of valuable information in this book. Author Chris F. A. Johnson provides an extensive education on scripting including scripts for viewing, editing, and manipulating files, manipulating strings, altering the path variable, monitoring the file system, filtering spam, backing up, archiving, deleting, and many other common tasks. How far can you go with a shell script? He even gives a working example of a database application written completely in script. On the other hand if you just want to have some fun there are even scripts for creating anagrams, fitting words into a crossword, or finding words that contain a given set of characters.

While the book is really written for the technically oriented reader, even the very basics that most users should already know are still covered. The format is more typical of what computer technicians want - this is the item to be discussed, this is how it works, this is an example, move on to the next one. When I am looking for answers this is the format I prefer and I found this book extremely useful. It will be on my bookshelf as one of the first to grab when I want to do scripting in Linux. Advanced and powerful, a real resource for the power user of the Bourne shell, Shell Scripting Recipes is highly recommended.
5 of 6 people found the following review helpful
HASH(0x9f076e88) out of 5 stars Great book for "R&D"... June 12 2005
By Thomas Duff - Published on Amazon.com
Format: Paperback
I'm a strong believer in "R&D"... "Rob & Duplicate". Rather than reinvent the wheel, I'd prefer find code that works and use/modify it to fit my purposes. Chris F. A. Johnson has a book that fits that mindset perfectly... Shell Scripting Recipes - A Problem-Solution Approach (Apress).

Chapter List: The POSIX Shell and Command-Line Utilities; Playing With Files - Viewing, Manipulating, And Editing Text Files; String Briefs; What's In A Word?; Scripting By Numbers; Loose Names Sink Scripts - Bringing Sanity To Filenames; Treading A Righteous PATH; The Dating Game; Good Housekeeping - Monitoring And Tidying Up File Systems; POP Goes The E-Mail; PostScript - More Than An Afterthought; Screenplay - The screen-funcs Library; Backing Up The Drive; Aging, Archiving, And Deleting Files; Covering All Your Databases; Home On The Web; Taking Care Of Business; Random Acts Of Scripting; A Smorgasbord Of Scripts; Script Development Management; Internet Scripting Resources; Index

Johnson has written a book that is perfect for the person who has studied the basics and now wants to start applying their knowledge. The book is one page after another of scripts written to solve specific issues and scenarios that can be solved using scripting techniques. Each problem has the format of description, "How It Works", "Usage", "The Script", and any "Notes" that might apply to this situation. The vast majority of problems are covered in two or less pages, so the scripts and examples are very tight and concise. The scripts were tested by the author using bash, pdksh, KornShell 93, and ash. If this is the type and flavor of shell scripting you use, they you'll be able to use the scripts without too many fears of finding problems. If the author knows another technique to make the script applicable to more types of shell environments, those will be noted in the Notes for the particular problem.

I really liked the focused nature of the material and writing. This is the type of book that will either solve a specific problem you have or will give you ideas on automating/simplifying something that you've lived with for far too long. And with repeated perusals, you may find gems you overlooked the first time that now address a current need. Definitely the type of book that deserves to be on your bookshelf with dog-eared pages throughout.