25.03.2013 Views

Copyright Sams Teach Yourself Shell Programming in 24 Hours

Copyright Sams Teach Yourself Shell Programming in 24 Hours

Copyright Sams Teach Yourself Shell Programming in 24 Hours

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

● Chapters 15, "Text Filters," 16, "Filter<strong>in</strong>g Text Us<strong>in</strong>g Regular Expressions," and 17, "Filter<strong>in</strong>g Text<br />

with awk," cover text filter<strong>in</strong>g. These chapters show you how to use a variety of UNIX commands<br />

<strong>in</strong>clud<strong>in</strong>g grep, tr, sed, and awk.<br />

● Chapter 18, "Miscellaneous Tools," provides an <strong>in</strong>troduction to some tools that are used <strong>in</strong> shell<br />

programm<strong>in</strong>g. Some of the commands that are discussed <strong>in</strong>clude type, f<strong>in</strong>d, bc, and remsh.<br />

At this po<strong>in</strong>t, you will know enough about the shell and the external tools available <strong>in</strong> UNIX that you can<br />

solve most problems. The last part of the book, Part III, is designed to help you solve the most difficult<br />

problems encountered <strong>in</strong> shell programm<strong>in</strong>g. Part III spans Chapters 19 through <strong>24</strong> and covers the follow<strong>in</strong>g<br />

material:<br />

● Chapter 19, "Deal<strong>in</strong>g with Signals," expla<strong>in</strong>s the concept of signals and shows you how to deliver a<br />

signal and how to deal with a signal us<strong>in</strong>g the trap command.<br />

● Chapter 20, "Debugg<strong>in</strong>g," discusses the shell's built-<strong>in</strong> debugg<strong>in</strong>g tools. It shows you how to use<br />

syntax check<strong>in</strong>g and shell trac<strong>in</strong>g to track down bugs and fix them.<br />

● Chapters 21, "Problem Solv<strong>in</strong>g with Functions," and 22, "Problem Solv<strong>in</strong>g with <strong>Shell</strong> Scripts," cover<br />

problem solv<strong>in</strong>g. Chapter 21 covers problems that can be solved us<strong>in</strong>g functions. Chapter 22<br />

<strong>in</strong>troduces some real-world problems and shows you how to solve them us<strong>in</strong>g a shell script.<br />

● Chapter 23, "Script<strong>in</strong>g for Portability," covers the topic of portability. In this chapter, you rewrite<br />

several scripts from previous chapters to be portable to different versions of UNIX.<br />

● Chapter <strong>24</strong>, "<strong>Shell</strong> <strong>Programm<strong>in</strong>g</strong> FAQs," is a question-and-answer chapter. Several common<br />

programm<strong>in</strong>g questions are presented along with detailed answers and examples.<br />

Each chapter <strong>in</strong> this book <strong>in</strong>cludes complete syntax descriptions for the various commands along with<br />

several examples to illustrate the use of commands. The examples are designed to show you how to apply<br />

the commands to solve real problems. At the end of each chapter are a few questions that you can use to<br />

check your progress. Some of the questions are short answer while others require you to write scripts.<br />

After Chapter <strong>24</strong>, three appendixes are available for your reference:<br />

● Appendix A, "Command Quick Reference," provides you with a complete command reference.<br />

● Appendix B, "Glossary," conta<strong>in</strong>s the terms used <strong>in</strong> this book.<br />

● Appendix C, "Quiz Answers," conta<strong>in</strong>s the answers to all the questions <strong>in</strong> the book.<br />

About the Examples<br />

As you work through the chapters, try typ<strong>in</strong>g <strong>in</strong> the examples to get a better feel<strong>in</strong>g of how the computer<br />

responds and how each command works. After you get an example work<strong>in</strong>g, try experiment<strong>in</strong>g with the<br />

example by chang<strong>in</strong>g commands. Don't be afraid to experiment. Experiments (both successes and failures)<br />

teach you important th<strong>in</strong>gs about UNIX and the shell.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!