Wicked Cool Shell Scripts
Introduction

If you've used Unix for any length of time, you've probably found yourself starting to push the envelope, tweak how things work, change the default flags for commands you use a lot, and even create rudimentary shell scripts that automate simple tasks in a coherent fashion. Even if all you've done is to create an alias or two, you've taken the first step on the road to being a shell script hacker extraordinaire. I've been using Unix for more years than I want to think about, and it's a great OS, especially because I can tweak, tune, and hack it. From simply automating common tasks to creating sophisticated, user-friendly versions of existing Unix commands, to creating brand new utilities that serve a useful purpose, I've been creating spiffo little shell scripts for quite a while.

This book is about making Unix a friendlier, more powerful, and more personal computing environment by exploiting the remarkable power and capabilities of the shell. Without writing a single line of C or C++, without invoking a single compiler and loader, and without having to take any classes in program design and methodology, you'll learn to write dozens of wicked cool shell scripts, ranging from an interactive calculator to a stable-of-contentsk ticker monitor, to a set of scripts that make analyzing Apache log files a breeze.

Wicked Cool Shell Scripts: The Table of Contents

Chapter 1: The Missing Code Library
#1 Finding Programs in the PATH
#2 Validating Input: Alphanumeric Only
#3 Normalizing Date Formats
#4 Presenting Large Numbers Attractively
#5 Validating Integer Input
#6 Validating Floating-Point Input
#7 Validating Date Formats
#8 Sidestepping Poor Echo Implementations
#9 An Arbitrary-Precision Floating-Point Calculator
#10 Locking Files
#11 ANSI Color Sequences
#12 Building a Shell Script Library
#13 Debugging Shell Scripts
Chapter 2: Improving on User Commands
#14 Formatting Long Lines
#15 Archiving Files As They're Removed
#16 Working with the Removed File Archive
#17 Logging File Removals
#18 Displaying the Contents of Directories
#19 Locating Files by Filename
#20 Emulating Another Environment: DIR
#21 Digging Around in the Man Page Database
#22 Displaying the Time in Different Time Zones
Chapter 3: Creating Utilities
#23 A Reminder Utility
#24 An Interactive Calculator
#25 Checking the Spelling of Individual Words
#26 Shpell: An Interactive Spell-Checking Facility
#27 Adding a Local Dictionary to Spell
#28 Converting Temperatures
#29 Calculating Loan Payments
#30 Keeping Track of Events
Chapter 4: Tweaking Unix
#31 Displaying a File with Line Numbers
#32 Displaying a File with Additional Information
#33 Wrapping Only Long Lines
#34 Emulating GNU-Style Flags with Quota
#35 Making sftp Look More Like ftp
#36 Fixing grep
#37 Working with Compressed Files
#38 Ensuring Maximally Compressed Files [ read it! ]
Chapter 5: System Administration: Managing Users
#39 Analyzing Disk Usage
#40 Reporting Disk Hogs
#41 Figuring Out Available Disk Space
#42 Improving the Readability of df Output
#43 Implementing a Secure Locate
#44 Adding Users to the System
#45 Suspending a User Account
#46 Deleting a User Account
#47 Validating the User Environment
#48 Cleaning Up After Guests Leave
Chapter 6: System Administration: System Maintenance
#49 Tracking Set User ID Applications
#50 Setting the System Date
#51 Displaying Which Services Are Enabled
#52 Killing Processes by Name
#53 Validating User crontab Entries
#54 Ensuring That System cron Jobs Are Run
#55 Rotating Log Files
#56 Managing Backups
#57 Backing Up Directories
Chapter 7: Web And Internet users
#58 Calculating Time Spent Online
#59 Downloading Files via FTP
#60 Tracking BBC News with lynx [ read it! ]
#61 Extracting URLs from a Web Page
#62 Defining Words Online
#63 Keeping Track of the Weather
#64 Checking for Overdue Books at the Library
#65 Digging Up Movie Info from IMDb
#66 Calculating Currency Values
#67 Tracking Your Stable-of-contentsk Portfolio
#68 Tracking Changes on Web Pages
Chapter 8: Webmaster Hacks
#69 Seeing the CGI Environment
#70 Logging Web Events
#71 Building Web Pages on the Fly
#72 Processing Contact Forms
#73 Creating a Web-Based Photo Album
#74 Building a Guest Book
#75 Creating a Text-Based Web Page Counter
#76 Displaying Random Text
Chapter 9: Web and Internet Administration
#77 Identifying Broken Internal Links
#78 Reporting Broken External Links
#79 Verifying Spelling on Web Pages
#80 Managing Apache Passwords
#81 Synchronizing Directories with FTP
#82 Synchronizing to a Remote Directory via FTP
#83 Synchronizing Files with SFTP
Chapter 10: Internet Server Administration
#84 Exploring the Apache access_log [ read it! ]
#85 Understanding Search Engine Traffic
#86 Exploring the Apache error_log
#87 Avoiding Disaster with a Remote Archive
#88 Mirroring a Website
#89 Tracking FTP Usage
#90 Monitoring Network Status
#91 Renicing Tasks by Process Name
#92 Adding New Virtual Host Accounts
Chapter 11: Mac OS X Scripts
#93 List NetInfo Users
#94 Adding a User to a Mac OS X System
#95 Adding an Email Alias
#96 Set the Terminal Title Dynamically
#97 Producing Summary Listings of iTunes Libraries
#98 Fixing the Open Command
Chapter 12: Shell Script Fun and Games
#99 Unscramble: A Word Game [ read it! ]
#100 Guess the Word Before It's Too Late: Hangman
#101 A State Capitals Quiz

Explore The Book!
[book cover]
Table of Contents
Read Some Scripts!
Shell Script Library
Book Errata
All The Links
Read the Reviews
Talk About It
Author Bio
Buy The Book!



Other books by author Dave Taylor
Learning Unix for Mac OS X (O'Reilly & Associates)
Solaris 9 for Dummies (Wiley)
Teach Yourself Unix in 24 Hours (Sams/Macmillan)
Teach Yourself Unix System Administration in 24 Hours (Sams/Macmillan)
Creating Cool HTML 4 Web Pages (Wiley)