[Chapter 10] 10.4 Aliases in ksh and bash
Author: Jerry Peek, Tim O'Reilly & Mike Loukides
Date: 1998-08-04T21:35:48Z

#

| Chapter 10 Aliases |

## 10.4 Aliases in ksh and bash

Virtually everything we've said about aliases applies to the Korn shell (ksh) and bash. One thing that's different is the syntax of the alias command, which is:

>     $ alias name=definition

That is, you need an equal sign (no spaces) between the name and the definition. A good guideline is to use single quotes (`'`) around the definition unless you're doing something specialized and you understand how quoting (8.14) works in aliases.

You also can't put arguments inside an alias as the C shell's `\!` operator (10.3) does. To do that, use a shell function (10.9).

Korn shell aliasing is "overloaded" with a few other functions - like keeping track of the locations of executables. However, this shouldn't prevent you from defining your own aliases as you need them.

- ML

10.3 C Shell Aliases with Command-Line Arguments |  | 10.5 Sourceable Scripts