Although there are virtually unlimited uses for shell scripts (for example, we know of at least one that generates Web pages that are thumbnail indexes of images: www.acme.com/software/thumbnail_index), there are some uses that are more common than others. Here are the most common uses of shell scripts.
Mac OS X/Darwin keeps its system-startup files in /System/Library/StartupItem (virtually every other version of Unix keeps similar scripts in /etc/rc.d or /etc/init.d ).
One example is the Bourne shell script /etc/weekly , which is run once each week by a scheduling program called launchd . (See Chapter 11, "Introduction to System Administration," to learn about the launchd command.) The /etc/weekly script rebuilds a couple of databases and compresses a few system log files. You can open it using vi or nano if you likeyou won't hurt anything by reading the file.
In Chapter 2 you created a simple script to show a system status report. As you become more comfortable with Unix, you will undoubtedly create several small scripts to automate tasks, provide new commands, and in general handle problems that the existing set of commands doesn't quite cover. One example might be a shell script that allows you to use the Macintosh Trash from the command line.