LINUX & UNIX Shell Programming
June 1st, 2000 by Marjorie Richardson in

Author: David Tansley
Publisher: Addison-Wesley
E-mail: info@awl.com
Price: $44.95 US
ISBN: 0-201-67472-6
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.
Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer
Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.
Subscribe now!
The Latest
Newsletter
Featured Videos
Set up a secure virtual host in Apache
December 22nd, 2008 by Elliot Isaacson in
Setting up an https server in Apache is easy. This tutorial covers how to create and sign your ssl certificate as well as how to configure the web server.
Recently Popular
From the Magazine
January 2009, #177
It's a battle as old as time: good vs. evil. Fortunately, Linux and FOSS are on our side as we wage the battle against those who try to steal our secrets and invade our systems.
Checking your system's security is best done sooner rather than later. Test the locks with our article on security verification; find out how to use PAM to help secure your systems; use MinorFS and AppArmor to implement discretionary access control; learn more about Samba security in part III of our series; use Darknet to help detect bots and secure your systems; use the Yubikey to increase your site's security; and don't forget to lock the doors, because a cold boot attack could render your security useless if somebody has physical access to your computer.
But, we're not just about sowing the seeds of fear. We also show you how to use memcached in Rails, how to manage multiple servers efficiently, how to deploy applications easily with Capistrano, how to manage your videos with MythVideo, how to mix it up a bit (your audio that is), and even play a few games.

Delicious
Digg
Reddit
Newsvine
Technorati





Post new comment