10.2 Shell Aliases and Functions


If you type command names that are hard for you to remember, or command lines that seem too long, you'll want to learn about shell aliases and shell functions . These shell features let you abbreviate commands, command lines, and long series of commands. In most cases, you can replace them with a single word or a word and a few arguments. For example, one of the long pipelines (see Section 6.2 in Chapter 6) could be replaced by an alias or function (for instance, aug ). When you type aug at a shell prompt, the shell would list files modified in August, sorted by size.

Making an alias or function is almost as simple as typing in the command line or lines that you want to run. References in Section 10.1 earlier in this chapter, have more information. Shell aliases and functions are actually a simple case of shell programming. For more information on aliases, see Section 1.3.2 in Chapter 1.



Learning Unix for Mac OS X Panther
Learning Unix for Mac OS X Panther
ISBN: 0596006179
EAN: 2147483647
Year: 2003
Pages: 88

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net