UNIX Shells by Example
Author: Ellie Quigley
Publisher: Prentice Hall
Price: $49.95 US
Reviewer: Ben Crowder
Unix Shells by Example truly fulfills the claim made in the title: over 630 examples are in the book, plus another 60 in the first appendix. If you want to learn shell programming, this book is a must-have.
The first chapter introduces the three major shells: the Bourne shell, the C shell and the Korn shell. The Bourne Again shell (bash), the one used by most Linux users, isn't specifically covered, but the information on the other three shells usually applies. A history of each shell, plus the theory behind shells is given. Where the shell comes in on a UNIX system is described, as well as more general UNIX topics such as file attributes and permissions.
Chapter Two, “The UNIX Tool Box”, gives a very useful explanation of regular expressions which applies to much more than shell programming; for example, searching for text within Emacs or vim is built on basically the same principle. Over the next six chapters, what are considered to be three of the more important UNIX tools in regard to shell programming are covered.
Our friend grep appears in the third chapter—the meaning behind the name, how it works, and how to use it (with, of course, extensive examples). Chapter Four covers sed, the Streamlined Editor—again, replete with examples.
The next three chapters describe awk--the history, the input format, records and fields, patterns and actions, script files, comparison expressions, variables, pipes, loops and arrays, to name just a few topics. This section is quite extensive and very useful. I would have to agree with the author that these three are among the most important of all text processing utilities.
Each of the three major shells is covered in a separate chapter. Chapter Eight introduces the Bourne shell, discussing topics such as variables, metacharacters, file-name substitution, pipes, functions, arithmetic, looping and the built-in shell commands, in addition to many other subjects of interest.
The C shell appears in the next chapter. Each shell is given basically the same treatment: the first section of the chapter is devoted to the interactive shell (aliases, job control, the environment, redirection, etc.), while the second section covers programming in that shell (loops, flow control, arithmetic, etc.). Chapter Ten goes over the Korn shell in the same manner.
Appendix A lists useful utilities for shell programmers. These are stock UNIX programs, such as at, mv, passwd and so on. Quite a few examples are given (sixty, to be precise), as well as usage information and a short description. Appendix B provides a table for comparing the three shells. This is an invaluable resource for those who need to port shell scripts from one shell to another. For example, the table shows you how, in each shell, to assign the output of a command to a variable. In the C shell you use set d='date', in the Bourne shell you use d='date', and in the Korn shell you use d=$(date) or d='date'. Appendix C explains clearly and concisely how to use quoting correctly, especially for those tricky problems where you have multiple layers of quotes. The attached CD comes with all source code given in the book.
So, is the book worth your time and money? Yes, very much so. I found the examples to be particularly helpful, illustrating concepts far more clearly than prose could possibly do. If you're interested in shell programming, or even if you're just curious about shells in general, get over to your local bookstore and buy this book.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- SuperTuxKart 0.9.2 Released
- Doing for User Space What We Did for Kernel Space
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide