LINUX & UNIX Shell Programming
Author: David Tansley
Price: $44.95 US
Reviewer: Marjorie Richardson
When beginning to read LINUX & UNIX Shell Programming, I was a bit confused to find I was reading about shell basics and not programming. My conclusion was, Mr. Tansley is writing for the true beginner to UNIX and so is first providing background and command information that will be needed when the user actually begins writing scripts. He is covering the basic or Bourne shell, which is common to all UNIX flavors including Linux, so scripts will be portable. More than once, he emphasizes the fact that his scripts are not the most efficient design, but are easy to understand and reuse. The back of the book states all scripts are available via an FTP site, but then doesn't give an address, and I couldn't find one in the book—strange.
The book is divided into five parts. Not until Part 4 does Mr. Tansley actually begin to talk about programming. He expects the reader to know only how to log in and use a text editor. While this was a bit disappointing for me, it won't be for someone who has not worked with UNIX for as long as I have.
This book needed better editing; the mistakes I found should have been caught. Mr. Tansley has been a UNIX system administrator for some time and clearly knows his subject. But run-on sentences with improper punctuation, extra words, omitted words and misspellings (e.g., dirrectory) make understanding the material harder than it should be. An entire chapter is devoted to the find command, and it contains two serious editing problems. One, when explaining the use of the mtime option on page 25, this statement appears:
Use “-” to specify files that have not been accessed in x number of days. Use “+” for files that have been accessed.
This has the meanings of - and + reversed, as is demonstrated in his printed examples. Two, in his explanation of the exec option, there is this statement:
To use exec you do have to have the “-print” option on.
In general, the explanations are good, though not heavily detailed. The author's style is casual and simple, making it easy to read and understand. He discusses many useful things such as find, cron, grep, wild cards, pipes, input/output, awk, sed, environment variables and many shell commands. All this is a prelude to getting down to the serious business of scripting.
Part 4 covers shell scripting, and Part 5 covers better shell scripting. Part 4 begins with explanations of how to use test and expr to determine file status and string evaluation—a very good place to start, indeed. Then he moves on to discuss flow control structures (e.g., if-then-else, for, while and case), exit status, creation of menus and printing. Examples are simple and to the point, demonstrating the current topic quite aptly. A good example is how to make your script interactive; that is, accept input from the keyboard rather than run in the background. Also in Part 4, he covers passing parameters, creating screen input, debugging and built-in commands.
Part 5 goes on to advanced scripting, with more details on “here” files and how-tos for run-level and cgi scripts. He includes a goodly sample of his own administration scripts which are quite helpful. There is much useful information in these two sections to help the beginning scripter. I did not find technical errors in these parts as I did in the beginning.
LINUX & UNIX Shell Programming is a good introduction to the shell as well as scripting. With a good editor, it will be even better in a second edition. Right now, I hesitate to recommend it to complete beginners, even though they are its target audience; however, for someone who has used UNIX for a short while and has the ability to sort out any confusions caused by typos, it could provide a useful reference.
Getting Started with DevOps - Including New Data on IT Performance from Puppet Labs 2015 State of DevOps Report
August 27, 2015
12:00 PM CDT
DevOps represents a profound change from the way most IT departments have traditionally worked: from siloed teams and high-anxiety releases to everyone collaborating on uneventful and more frequent releases of higher-quality code. It doesn't matter how large or small an organization is, or even whether it's historically slow moving or risk averse — there are ways to adopt DevOps sanely, and get measurable results in just weeks.
Free to Linux Journal readers.Register Now!
- Django Models and Migrations
- Hacking a Safe with Bash
- Secure Server Deployments in Hostile Territory, Part II
- Huge Package Overhaul for Debian and Ubuntu
- The Controversy Behind Canonical's Intellectual Property Policy
- Home Automation with Raspberry Pi
- Shashlik - a Tasty New Android Simulator
- Embed Linux in Monitoring and Control Systems
- KDE Reveals Plasma Mobile
- Purism Librem 13 Review