Book description
This ebook does not provide access to the companion materials.
UNIX expert Randal K. Michael guides you through every detail of writing shell scripts to automate specific tasks. Each chapter begins with a typical, everyday UNIX challenge, then shows you how to take basic syntax and turn it into a shell scripting solution. Covering Bash, Bourne, and Korn shell scripting, this updated edition provides complete shell scripts plus detailed descriptions of each part. UNIX programmers and system administrators can tailor these to build tools that monitor for specific system events and situations, building solid UNIX shell scripting skills to solve real-world system administration problems.
Table of contents
- Cover Page
- Title page
- Copyright
- Dedication
- About the Author
- Credits
- Contents
- Acknowledgments
- Introduction
-
Part I: The Basics of Shell Scripting
-
CHAPTER 1: Scripting Quick Start and Review
- Case Sensitivity
- UNIX Special Characters
- Shells
- Shell Scripts
- Functions
- Running a Shell Script
- Comments and Style in Shell Scripts
- Control Structures
- Using break, continue, exit, and return
- Here Document
- Shell Script Commands
- Symbol Commands
- Variables
- Command-Line Arguments
- shift Command
- Special Parameters $* and $@
- Double Quotes, Forward Tics, and Back Tics
- Using awk on Solaris
- Using the echo Command Correctly
- Math in a Shell Script
- Built-In Mathematical Functions
- File Permissions, suid and sgid Programs
- Running Commands on a Remote Host
- Setting Traps
- User-Information Commands
- ps Command
- Communicating with Users
- Uppercase or Lowercase Text for Easy Testing
- Check the Return Code
- Time-Based Script Execution
- Output Control
- Catching a Delayed Command Output
- Fastest Ways to Process a File Line-by-Line
- Using Command Output in a Loop
- Mail Notification Techniques
- Creating a Progress Indicator
- Working with Record Files
- Creating a Pseudo-Random Number
- Checking for Stale Disk Partitions in AIX
- Automated Host Pinging
- Highlighting Specific Text in a File
- Keeping the Printers Printing
- Automated FTP File Transfer
- Using rsync to Replicate Data
- Capturing a List of Files Larger than $MEG
- Capturing a User's Keystrokes
- Using the bc Utility for Floating-Point Math
- Number Base Conversions
- Create a Menu with the select Command
- Removing Repeated Lines in a File
- Removing Blank Lines from a File
- Testing for a Null Variable
- Directly Access the Value of the Last Positional Parameter, $#
- Remove the Column Headings in a Command Output
- Arrays
- Testing a String
- Summary
- CHAPTER 2: 24 Ways to Process a File Line-by-Line
- CHAPTER 3: Automated Event Notification
- CHAPTER 4: Progress Indicators Using a Series of Dots, a Rotating Line, or Elapsed Time
-
CHAPTER 1: Scripting Quick Start and Review
-
Part II: Scripts for Programmers, Testers, and Analysts
- CHAPTER 5: Working with Record Files
- CHAPTER 6: Automated FTP Stuff
- CHAPTER 7: Using rsync to Efficiently Replicate Data
- CHAPTER 8: Automating Interactive Programs with Expect and Autoexpect
- CHAPTER 9: Finding Large Files and Files of a Specific Type
- CHAPTER 10: Process Monitoring and Enabling Pre-Processing, Startup, and Post-Processing Events
- CHAPTER 11: Pseudo-Random Number and Data Generation
- CHAPTER 12: Creating Pseudo-Random Passwords
- CHAPTER 13: Floating-Point Math and the bc Utility
- CHAPTER 14: Number Base Conversions
- CHAPTER 15: hgrep: Highlighted grep Script
- CHAPTER 16: Monitoring Processes and Applications
-
Part III: Scripts for Systems Administrators
- CHAPTER 17: Filesystem Monitoring
- CHAPTER 18: Monitoring Paging and Swap Space
- CHAPTER 19: Monitoring System Load
- CHAPTER 20: Monitoring for Stale Disk Partitions (AIX-Specific)
- CHAPTER 21: Turning On/Off SSA Identification Lights
- CHAPTER 22: Automated Hosts Pinging with Notification of Failure
- CHAPTER 23: Creating a System-Configuration Snapshot
- CHAPTER 24: Compiling, Installing, Configuring, and Using sudo
- CHAPTER 25: Print-Queue Hell: Keeping the Printers Printing
- CHAPTER 26: Those Pesky Sarbanes-Oxley (SOX) Audits
- CHAPTER 27: Using Dirvish with rsync to Create Snapshot-Type Backups
- CHAPTER 28: Monitoring and Auditing User Keystrokes
- APPENDIX A: What's on the Web Site
- Index
Product information
- Title: Mastering UNIX® Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus, Second Edition
- Author(s):
- Release date: June 2008
- Publisher(s): Wiley
- ISBN: 9780470183014
You might also like
video
Bash Shell Scripting, 2nd Edition
8 Hours of Video Instruction Overview Bash is the best way for you to efficiently and …
video
Complete Bash Shell Scripting
Many organizations favor Bash scripts for executing shell commands, running and customizing administrative tasks, automating repetitive …
book
Linux Command Line and Shell Scripting Bible, 4th Edition
Advance your understanding of the Linux command line with this invaluable resource Linux Command Line and …
book
Linux Command Line and Shell Scripting Bible, 3rd Edition
Talk directly to your system for a faster workflow with automation capability Linux Command Line and …