Wrappers

The opposite of a shellout is a wrapper. A wrapper either creates a new interface for or specializes a called program. Often, wrappers are used to hide the details of elaborate shell pipelines. We'll discuss interface wrappers in chapter 11 (User Interfaces). Most specialization wrappers are quite simple, but nevertheless very useful.

As with shellouts, there is no associated protocol because the programs do not communicate during the execution of the callee; but the wrapper usually exists to specify arguments that modify the callee's behavior.

Specialization wrappers are a classic use of the Unix shell and other scripting languages. One kind of specialization wrapper that is both common and representative is a backup script. It may be a one-liner as simple as this:

tar -czvf /dev/st0 $@

a wrapper for the tar(1) tape archiver utility which simply supplies one fixed argument (the tape device /dev/st0) and passes to tar all the other arguments supplied by the user ($*).