Cover image for Mastering Unix Shell Scripting : Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus.
Mastering Unix Shell Scripting : Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus.
Title:
Mastering Unix Shell Scripting : Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus.
Author:
Michael, Randal K.
ISBN:
9780470378298
Personal Author:
Edition:
2nd ed.
Physical Description:
1 online resource (1034 pages)
Contents:
Mastering UNIX Shell Scripting: Bash, Bourne, and Korn Shell Scripting for Programmers, System Administrators, and UNIX Gurus, Second Edition -- About the Author -- Credits -- Contents -- Acknowledgments -- Introduction -- Overview of the Book and Technology -- How This Book Is Organized -- Who Should Read this Book -- Tools You Will Need -- What's on the Web Site -- Summary -- 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 -- Command Syntax -- 24 Methods to Parse a File Line-by-Line -- Timing Each Method -- What about Using Command Input Instead of File Input? -- Summary -- Lab Assignments -- Chapter 3: Automated Event Notification -- Basics of Automating Event Notification -- Problems with Outbound Mail -- Dial-Out Modem Software -- SNMP Traps -- Summary -- Lab Assignments -- Chapter 4: Progress Indicators Using a Series of Dots, a Rotating Line, or Elapsed Time -- Indicating Progress with a Series of Dots -- Indicating Progress with a Rotating Line -- Indicating Progress with Elapsed Time -- Combining Feedback Methods -- Other Options to Consider -- Summary -- Lab Assignments -- Part II: Scripts for Programmers, Testers, and Analysts -- Chapter 5: Working with Record Files -- What Is a Record File? -- Processing the Record Files -- Tasks for Records and Record Files -- The Merge Process -- Putting It All Together -- Other Things to Consider -- Summary -- Lab Assignments -- Chapter 6: Automated FTP Stuff -- Syntax -- Automating File Transfers and Remote Directory Listings -- What about Encryption? -- Other Things to Consider -- Summary -- Lab Assignments -- Chapter 7: Using rsync to Efficiently Replicate Data -- Syntax -- Generic rsync Shell Script -- Replicating Multiple Directories with rsync -- Replicating Multiple Filesystems with rsync -- Replicating an Oracle Database with rsync -- rsync Copy Shell Script -- Summary -- Lab Assignments.

Chapter 8: Automating Interactive Programs with Expect and Autoexpect -- Downloading and Installing Expect -- The Basics of Talking to an Interactive Script or Program -- Using autoexpect to Automatically Create an Expect Script -- Working with Variables -- What about Conditional Tests? -- Using Expect Scripts with Sun Blade Chassis and JumpStart -- Summary -- Lab Assignments -- Chapter 9: Finding Large Files and Files of a Specific Type -- Syntax -- Remember That File and Directory Permissions Thing -- Don't Be Shocked by the Size of the Files -- Creating the Script -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 10: Process Monitoring and Enabling Pre-Processing, Startup, and Post-Processing Events -- Syntax -- Monitoring for a Process to Start -- Monitoring for a Process to End -- Monitor and Log as a Process Starts and Stops -- Timed Execution for Process Monitoring, Showing Each PID, and Timestamp with Event and Timing Capability -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 11: Pseudo-Random Number and Data Generation -- What Makes a Random Number? -- The Methods -- Shell Script to Create Pseudo-Random Numbers -- Creating Unique Filenames -- Creating a File Filled with Random Characters -- Other Things to Consider -- Summary -- Lab Assignments -- Chapter 12: Creating Pseudo-Random Passwords -- Randomness -- Creating Pseudo-Random Passwords -- Syntax -- Building the Password-Creation Script -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 13: Floating-Point Math and the bc Utility -- Syntax -- Creating Some Shell Scripts Using bc -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 14: Number Base Conversions -- Syntax -- Scripting the Solution -- An Easy, Interactive Script to Convert Between Bases -- Using the bc Utility for Number Base Conversions.

Other Options to Consider -- Summary -- Lab Assignments -- Chapter 15: hgrep: Highlighted grep Script -- Reverse Video Control -- Building the hgrep. Bash Shell Script -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 16: Monitoring Processes and Applications -- Monitoring Local Processes -- Remote Monitoring with Secure Shell and Remote Shell -- What about Waiting for Something to Complete Executing? -- Other Things to Consider -- Summary -- Lab Assignments -- Part III: Scripts for Systems Administrators -- Chapter 17: Filesystem Monitoring -- Syntax -- Adding Exceptions Capability to Monitoring -- Using the MB-of-Free-Space Method -- Using MB of Free Space with Exceptions -- Percentage Used - MB Free and Large Filesystems -- Running Filesystem Scripts on AIX, Linux, HP-UX, OpenBSD, and Solaris -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 18: Monitoring Paging and Swap Space -- Syntax -- Creating the Shell Scripts -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 19: Monitoring System Load -- Installing the System-Statistics Programs in Linux -- Syntax -- Scripting the Solutions -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 20: Monitoring for Stale Disk Partitions (AIX-Specific) -- AIX Logical Volume Manager (LVM) -- The Commands and Methods -- Other Options to Consider -- Summary -- Lab Assignment -- Chapter 21: Turning On/Off SSA Identification Lights -- Syntax -- The Scripting Process -- Other Things to Consider -- Summary -- Lab Assignment -- Chapter 22: Automated Hosts Pinging with Notification of Failure -- Syntax -- Creating the Shell Script -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 23: Creating a System-Configuration Snapshot -- Syntax -- Creating the Shell Script -- Other Options to Consider -- Summary -- Lab Assignment.

Chapter 24: Compiling, Installing, Configuring, and Using sudo -- The Need for sudo -- Configuring sudo on Solaris -- Downloading and Compiling sudo -- Compiling sudo -- Configuring sudo -- Using sudo -- Using sudo in a Shell Script -- Logging to the syslog with sudo -- The sudo Log File -- Summary -- Lab Assignments -- Chapter 25: Print-Queue Hell: Keeping the Printers Printing -- System V versus BSD versus CUPS Printer Systems -- Putting It All Together -- Other Options to Consider -- Summary -- Lab Assignments -- Chapter 26: Those Pesky Sarbanes-Oxley (SOX) Audits -- What to Expect -- How to Work with the Auditors -- What the Auditors Want to See -- Some Handy Commands -- Using the dirname and basename Commands -- Other Things to Consider -- Summary -- Lab Assignments -- Chapter 27: Using Dirvish with rsync to Create Snapshot-Type Backups -- How Does Dirvish Work? -- Configuring Dirvish -- Performing a Full System Backup -- Using Dirvish on the Command Line -- A Menu-Interface Shell Script to Control Dirvish -- Putting It All Together -- Using the dirvish ctrl Shell Script -- Other Things to Consider -- Summary -- Lab Assignments -- Chapter 28: Monitoring and Auditing User Keystrokes -- Syntax -- Scripting the Solution -- Other Options to Consider -- Summary -- Lab Assignments -- A Closing Note from the Author -- Appendix A: What's on the Web Site -- Shell Scripts -- Functions -- Index.
Abstract:
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.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: