Buying Options
Classic Shell Scripting
Print $34.95
Add to Cart
Print+Ebook $38.45
Add to Cart
Ebook $27.99
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £26.99
Add to Cart
What is this?
Description
An essential skill for Unix users and system administrators, shell scripts let you easily crunch data and automate repetitive tasks, offering a way to quickly harness the full power of any Unix system. This book provides the tips, tricks, and organized knowledge you need to create excellent scripts, as well as warnings of the traps that can turn your best efforts into bad shell scripts.
Full Description
Table of Contents
  1. Chapter 1 Background

    1. Unix History

    2. Software Tools Principles

    3. Summary

  2. Chapter 2 Getting Started

    1. Scripting Languages Versus Compiled Languages

    2. Why Use a Shell Script?

    3. A Simple Script

    4. Self-Contained Scripts: The #! First Line

    5. Basic Shell Constructs

    6. Accessing Shell Script Arguments

    7. Simple Execution Tracing

    8. Internationalization and Localization

    9. Summary

  3. Chapter 3 Searching and Substitutions

    1. Searching for Text

    2. Regular Expressions

    3. Working with Fields

    4. Summary

  4. Chapter 4 Text Processing Tools

    1. Sorting Text

    2. Removing Duplicates

    3. Reformatting Paragraphs

    4. Counting Lines, Words, and Characters

    5. Printing

    6. Extracting the First and Last Lines

    7. Summary

  5. Chapter 5 Pipelines Can Do Amazing Things

    1. Extracting Data from Structured Text Files

    2. Structured Data for the Web

    3. Cheating at Word Puzzles

    4. Word Lists

    5. Tag Lists

    6. Summary

  6. Chapter 6 Variables, Making Decisions, and Repeating Actions

    1. Variables and Arithmetic

    2. Exit Statuses

    3. The case Statement

    4. Looping

    5. Functions

    6. Summary

  7. Chapter 7 Input and Output, Files, and Command Evaluation

    1. Standard Input, Output, and Error

    2. Reading Lines with read

    3. More About Redirections

    4. The Full Story on printf

    5. Tilde Expansion and Wildcards

    6. Command Substitution

    7. Quoting

    8. Evaluation Order and eval

    9. Built-in Commands

    10. Summary

  8. Chapter 8 Production Scripts

    1. Path Searching

    2. Automating Software Builds

    3. Summary

  9. Chapter 9 Enough awk to Be Dangerous

    1. The awk Command Line

    2. The awk Programming Model

    3. Program Elements

    4. Records and Fields

    5. Patterns and Actions

    6. One-Line Programs in awk

    7. Statements

    8. User-Defined Functions

    9. String Functions

    10. Numeric Functions

    11. Summary

  10. Chapter 10 Working with Files

    1. Listing Files

    2. Updating Modification Times with touch

    3. Creating and Using Temporary Files

    4. Finding Files

    5. Running Commands: xargs

    6. Filesystem Space Information

    7. Comparing Files

    8. Summary

  11. Chapter 11 Extended Example: Merging User Databases

    1. The Problem

    2. The Password Files

    3. Merging Password Files

    4. Changing File Ownership

    5. Other Real-World Issues

    6. Summary

  12. Chapter 12 Spellchecking

    1. The spell Program

    2. The Original Unix Spellchecking Prototype

    3. Improving ispell and aspell

    4. A Spellchecker in awk

    5. Summary

  13. Chapter 13 Processes

    1. Process Creation

    2. Process Listing

    3. Process Control and Deletion

    4. Process System-Call Tracing

    5. Process Accounting

    6. Delayed Scheduling of Processes

    7. The /proc Filesystem

    8. Summary

  14. Chapter 14 Shell Portability Issues and Extensions

    1. Gotchas

    2. The bash shopt Command

    3. Common Extensions

    4. Download Information

    5. Other Extended Bourne-Style Shells

    6. Shell Versions

    7. Shell Initialization and Termination

    8. Summary

  15. Chapter 15 Secure Shell Scripts: Getting Started

    1. Tips for Secure Shell Scripts

    2. Restricted Shell

    3. Trojan Horses

    4. Setuid Shell Scripts: A Bad Idea

    5. ksh93 and Privileged Mode

    6. Summary

  16. Chapter 16 Bibliography

    1. Unix Programmer's Manuals

    2. Programming with the Unix Mindset

    3. Awk and Shell

    4. Standards

    5. Security and Cryptography

    6. Unix Internals

    7. O'Reilly Books

    8. Miscellaneous Books

  1. Colophon

View Full Table of Contents
Product Details
Title:
Classic Shell Scripting
By:
Arnold Robbins, Nelson H. F. Beebe
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
May 2005
Ebook Release:
December 2008
Pages:
560
Print ISBN:
978-0-596-00595-5
| ISBN 10:
0-596-00595-4
Ebook ISBN:
978-0-596-15949-8
| ISBN 10:
0-596-15949-8
Customer Reviews
About the Authors
  1. Arnold Robbins

    Arnold Robbins, an Atlanta native, is a professional programmer and technical author. He has worked with Unix systems since 1980, when he was introduced to a PDP-11 running a version of Sixth Edition Unix. He has been a heavy AWK user since 1987, when he became involved with gawk, the GNU project's version of AWK. As a member of the POSIX 1003.2 balloting group, he helped shape the POSIX standard for AWK. He is currently the maintainer of gawk and its documentation. He is also coauthor of the sixth edition of O'Reilly's Learning the vi Editor. Since late 1997, he and his family have been living happily in Israel.

    View Arnold Robbins's full profile page.

  2. Nelson H. F. Beebe

    Nelson Beebe is a long time Unix user and system administrator, and has helped for years on Usenet newsgroups.

    View Nelson H. F. Beebe's full profile page.

Colophon

Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Classic Shell Scripting is the knobby geometric or African tent tortoise (Psammobates tentorius). The genus Psammobates literally means "sand-loving," so it isn't surprising that the tent tortoise is found only in the steppes and outer desert zones of southern Africa. All species in this genus are small, ranging in size from five to ten inches, and have yellow radiating marks on their carapace. The tent tortoise is particularly striking, with arched scutes that look like tents. Tortoises are known for their long lifespan, and turtles and tortoises are also among the most ancient animal species alive today. They existed in the era of dinosaurs some 200 million years ago. All tortoises are temperature dependent, which means they eat only when the temperature is not too extreme. During hot summer and cold winter days, tortoises go into a torpor and stop feeding altogether. In the spring, the tent tortoise's diet consists of succulent, fibrous plants and grasses. In captivity, this species may hibernate from June to September, and will sometimes dig itself into a burrow and remain there for quite a long time. All "sand-loving" tortoises are very difficult to maintain in captivity. They are highly susceptible to shell disease and respiratory problems brought on by cold or damp environments, so their enclosures must be extremely sunny and dry. The popularity of these species among tortoise enthusiasts and commercial traders, along with the continued destruction of their natural habitat, has made the African tent tortoise among the top twenty-five most endangered tortoises in the world. Adam Witwer was the production editor and Audrey Doyle was the copyeditor for Classic Shell Scripting. Ann Schirmer proofread the text. Colleen Gorman and Claire Cloutier provided quality control. Angela Howard wrote the index. Emma Colby designed the cover of this book, based on a series design by Edie Freedman. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Karen Montgomery produced the cover layout with Adobe InDesign CS using Adobe's ITC Garamond font. David Futato designed the interior layout. This book was converted by Keith Fahlgren to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano, Jessamyn Read, and Lesley Borash using Macromedia FreeHand MX and Adobe Photoshop CS. The tip and warning icons were drawn by Christopher Bing. This colophon was written by Lydia Onofrei.The production editors for Book Title, eMatter Edition were Ellie Cutler and Jeff Liggett. Linda Walsh was the product manager. Kathleen Wilson provided design support. Lenny Muellner, Mike Sierra, Erik Ray, and Benn Salter provided technical support. This eMatter Edition was produced with FrameMaker 5.5.6.

  • Book cover of Classic Shell Scripting