UNIX Shells by Example

UNIX Shells by Example

5.0 1
by Ellie Quigley
     
 

View All Available Formats & Editions

Shell programs are the programs that are used as the interface between the user and the heart of the UNIX operating system, called the "kernel." The automation of shell tasks can be accomplished by more sophisticated UNIX programmers through the use of script files. This work introduces readers to the three major Unix shells (the Bourne, the C, and the Korn shells);… See more details below

Overview

Shell programs are the programs that are used as the interface between the user and the heart of the UNIX operating system, called the "kernel." The automation of shell tasks can be accomplished by more sophisticated UNIX programmers through the use of script files. This work introduces readers to the three major Unix shells (the Bourne, the C, and the Korn shells); the Linux shells (Bash and TC shells) and discusses tools, regular expressions, and quoting rules. The CD-ROM contains script files and datafiles used in the text. The use of small examples, which include the output and explanations of each line of programming, illustrate each concept. Annotation c. Book News, Inc., Portland, OR (booknews.com)

Editorial Reviews

Booknews
A guide to the C, Bourne, and Korn shells and the awk, sed, and grep Unix utilities, written by a silicon valley instructor. The second edition features more examples. An included CD-ROM contains the source code and data files used in the book. Annotation c. Book News, Inc., Portland, OR (booknews.com)

Product Details

ISBN-13:
9780134608662
Publisher:
Prentice Hall Professional Technical Reference
Publication date:
12/01/1996
Edition description:
Older Edition
Pages:
644
Product dimensions:
7.08(w) x 9.28(h) x 1.92(d)

Related Subjects

Read an Excerpt

PREFACE:

Preface

Playing the "shell" game is a lot of fun. This book was written to make your learning experience both fun and profitable. Since the first edition was published, I have heard from many of you who have been helped by my book to realize that shell programming doesn't need to be difficult at all! Learning by example makes it easy and fun. In fact, due to such positive feedback, I have been asked by Prentice Hall to produce this new, updated version.

Writing UNIX Shells by Example is the culmination of 17 years of teaching and developing classes for the various shells and those UNIX utilities most heavily used by shell programmers. The course notes I developed for teaching classes have been used by the University of California Santa Cruz and University of California Davis UNIX programs, Sun Microsystems Education, Pyramid Education, DeAnza College, and numerous vendors throughout the world. Depending on the requirements of my client, I normally teach one shell at a time rather than all three. To accommodate the needs of so many clients, I developed separate materials for each of the respective UNIX shells and tools.

Whether I am teaching "grep, sed, and awk," "Bourne Shell for the System Administrator," or "The Interactive Korn Shell," one student always asks: "What book can I get that covers all three shells and the important utilities such as grep, sed, and awk? Should I get the awk book, or should I get a book on grep and sed? Is there one book that really covers it all? I don't want to buy three or four books in order to become a shell programmer."

In response, I can recommend a number of excellent bookscovering these topics separately, and some UNIX books that attempt to do it all, but the students want one book with everything and not just a quick survey. They want the UNIX tools, regular expressions, all three shells, quoting rules, a comparison of the three shells, exercises, and so forth, all in one book. This is that book. As I wrote it, I thought about how I teach the classes and organized the chapters in the same format. In the shell programming classes, the first topic is always an introduction to what the shell is and how it works. Then we talk about the UNIX utilities such as grep, sed, and awk, the most important tools in the shell programmer's toolbox. When learning about the shell, it is presented first as an interactive program where everything can be accomplished at the command line, and then as a programming language where the programming constructs are described and demonstrated in shell scripts. When shell programming classes are over, whether they last two days or a week or even a semester, the students are proficient and excited about writing scripts. They have learned how to play the shell game. This book will teach how to play the same game whether you take a class or just play by yourself.

Having always found that simple examples are easier for quick comprehension, each concept is captured in a small example followed by the output and an explanation of each line of the program. This method has proven to be very popular with those who learned Perl programming from my first book, Perl by Example, and UNIX Shells by Example now has been well-received for those who needed to write, read, and maintain shell programs.

The three shells are presented in parallel so that if, for example, you want to know how redirection is performed in one shell, there is a parallel discussion of that topic in each of the other shell chapters, and for quick comparison a chart in Appendix B of this book.

It is a nuisance to have to go to another book or the UNIX man page when all you want is enough information about a particular command to jog your memory on how the command works. To save you time, Appendix A contains a list of useful commands, their syntax and a definition. Examples and explanations are provided for the more robust and often-used commands.

The comparison chart in Appendix B will help you keep the different shells straight especially when you port scripts from one shell to another, and as a quick syntax check when all that you need is a reminder of how the construct works.

One of the biggest hurdles for shell programmers is using quotes properly. The section on quoting rules in Appendix C presents a step-by-step process for successful quoting in some of the most complex command lines. This procedure has dramatically reduced the amount of time programmers waste when debugging scripts with futile attempts at matching quotes properly.

I think you'll find this book a valuable tutorial and reference. The objective is to explain through example and keep things simple so that you have fun learning and save time. Since the book replicates what I say in my classes, I am confident that you will be a productive shell programmer in a short amount of time. Everything you need is right here at your fingertips. Playing the shell game is fun. You'll see!

Ellie Quigley (ellieq@ellieq.com)

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >