Shell scripting skills never go out of style. It's the shell that unlocks the real potential of Unix. Shell scripting is essential for Unix users and system administrators-a way to quickly harness and customize the full power of any Unix system. With shell scripts, you can combine the fundamental Unix text and file processing commands to crunch data and automate repetitive tasks. But beneath this simple promise lies a treacherous ocean of variations in Unix commands and standards. Classic Shell Scripting is written to help you reliably navigate these tricky waters.
Writing shell scripts requires more than just a knowledge of the shell language, it also requires familiarity with the individual Unix programs: why each one is there, how to use them by themselves, and in combination with the other programs. The authors are intimately familiar with the tips and tricks that can be used to create excellent scripts, as well as the traps that can make your best effort a bad shell script. With Classic Shell Scripting you'll avoid hours of wasted effort. You'll learn not only write useful shell scripts, but how to do it properly and portably.
The ability to program and customize the shell quickly, reliably, and portably to get the best out of any individual system is an important skill for anyone operating and maintaining Unix or Linux systems. Classic Shell Scripting gives you everything you need to master these essential skills.
About the Authors
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.
Nelson Beebe is a long time Unix user and system administrator, and has helped for years on Usenet newsgroups.
|
Chapter 1 Background - Unix History
- Software Tools Principles
- Summary
Chapter 2 Getting Started - Scripting Languages Versus Compiled Languages
- Why Use a Shell Script?
- A Simple Script
- Self-Contained Scripts: The #! First Line
- Basic Shell Constructs
- Accessing Shell Script Arguments
- Simple Execution Tracing
- Internationalization and Localization
- Summary
Chapter 3 Searching and Substitutions - Searching for Text
- Regular Expressions
- Working with Fields
- Summary
Chapter 4 Text Processing Tools - Sorting Text
- Removing Duplicates
- Reformatting Paragraphs
- Counting Lines, Words, and Characters
- Printing
- Extracting the First and Last Lines
- Summary
Chapter 5 Pipelines Can Do Amazing Things - Extracting Data from Structured Text Files
- Structured Data for the Web
- Cheating at Word Puzzles
- Word Lists
- Tag Lists
- Summary
Chapter 6 Variables, Making Decisions, and Repeating Actions - Variables and Arithmetic
- Exit Statuses
- The case Statement
- Looping
- Functions
- Summary
Chapter 7 Input and Output, Files, and Command Evaluation - Standard Input, Output, and Error
- Reading Lines with read
- More About Redirections
- The Full Story on printf
- Tilde Expansion and Wildcards
- Command Substitution
- Quoting
- Evaluation Order and eval
- Built-in Commands
- Summary
Chapter 8 Production Scripts - Path Searching
- Automating Software Builds
- Summary
Chapter 9 Enough awk to Be Dangerous - The awk Command Line
- The awk Programming Model
- Program Elements
- Records and Fields
- Patterns and Actions
- One-Line Programs in awk
- Statements
- User-Defined Functions
- String Functions
- Numeric Functions
- Summary
Chapter 10 Working with Files - Listing Files
- Updating Modification Times with touch
- Creating and Using Temporary Files
- Finding Files
- Running Commands: xargs
- Filesystem Space Information
- Comparing Files
- Summary
Chapter 11 Extended Example: Merging User Databases - The Problem
- The Password Files
- Merging Password Files
- Changing File Ownership
- Other Real-World Issues
- Summary
Chapter 12 Spellchecking - The spell Program
- The Original Unix Spellchecking Prototype
- Improving ispell and aspell
- A Spellchecker in awk
- Summary
Chapter 13 Processes - Process Creation
- Process Listing
- Process Control and Deletion
- Process System-Call Tracing
- Process Accounting
- Delayed Scheduling of Processes
- The /proc Filesystem
- Summary
Chapter 14 Shell Portability Issues and Extensions - Gotchas
- The bash shopt Command
- Common Extensions
- Download Information
- Other Extended Bourne-Style Shells
- Shell Versions
- Shell Initialization and Termination
- Summary
Chapter 15 Secure Shell Scripts: Getting Started - Tips for Secure Shell Scripts
- Restricted Shell
- Trojan Horses
- Setuid Shell Scripts: A Bad Idea
- ksh93 and Privileged Mode
- Summary
Chapter 16 Bibliography - Unix Programmer's Manuals
- Programming with the Unix Mindset
- Awk and Shell
- Standards
- Security and Cryptography
- Unix Internals
- O'Reilly Books
- Miscellaneous Books
Colophon
|