Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


Alias

Built-in

SYNTAX

Alias [alias [commandString]]

DESCRIPTION

The Alias command creates a different name or "command alias" for a command or list of commands. This allows you to create abbreviations for commands that you use frequently, or to execute a group of commands using a single command alias that you define. You can execute command aliases or remove them with the Unalias command.

Although command aliases are local to the script in which they are defined, scripts can inherit an initial list of command aliases from an enclosing script. You can override these inherited command aliases locally. To make a command alias definition available to all scripts, you must place the Alias command in one of your UserStartup•name files.

You can also use Alias to output information about user-defined command aliases.

INPUT

None

OUTPUT

None, unless you omit one or more parameters. If you specify only alias, Alias writes any alias definition associated with alias to standard output. If you do not specify any parameters, Alias writes a list of all aliases and their values to standard output. In both cases the output appears in the form of Alias commands.

STATUS

Alias can return the following status codes:

0

no errors

1

specified alias not found; any other error

PARAMETERS

alias

Specifies the name of the alias.

commandString

Specifies the commands to be executed when the command alias is used. Place the entire parameter in quotation marks if it contains spaces or special characters. Separate the commands within the parameter by semicolons.

Since the MPW Shell processes the command string when the command alias is entered, the string must contain syntactically correct commands. This means that the commands must follow the rules of the MPW Shell, including the rules for nested quotation marks.

Since variables are subject to expansion, enclose them in either double or single quotation marks. Variables enclosed in double quotation marks are expanded when the Alias command is executed. Variables enclosed in single quotation marks are expanded when the alias is executed.

OPTIONS

None

EXAMPLES

The following command line creates the command alias named Dir for the Directory command.

Alias Dir Directory

In the following example, the command line creates a command alias named Top for the command Find •, which places the insertion point at the beginning of a window. Note that the Find command uses the target window, unless you specify the window parameter.

Alias Top 'Find •'

The Top command can now be used as follows:

Top                 # finds top of target window
Top Sample.a        # finds top of window Sample.a 
                    # (equivalent to "Find • Sample.a")

SEE ALSO

Unalias

 
 


Last Updated July 2000