[Guide to AmigaDOS 3\Alias] 
 

ALIAS

Format: ALIAS [<name>] [<string>] Template: NAME, STRING/F Purpose: To set or display command aliases. Path: Internal Specification: ALIAS permits you to create aliases, or alternative names, for AmigaDOS commands. Using an alias is like replacing a sentence with a single word. With ALIAS, you can abbreviate frequently used commands or replace a standard command name with a different name. When AmigaDOS encounters <name>, it replaces it with the defined <string>, integrates the result with the rest of the command line, and attempts to interpret and execute the resulting line as an AmigaDOS command. So <name> is the alias (whatever you want to call the command), and <string> is the command to be substituted for the alias. An alias must be entered at the beginning of the command line. You can enter arguments after the alias. However, you cannot create an alias to represent a series of command arguments. For example, in the following command line: 1> LIST PicDir TO RAM:filelist LFORMAT="SYS:Utilities/display %f%n" You could not replace the LFORMAT argument with an alias. You can substitute a filename or other instruction within an alias by placing square brackets ([ ]) in the <string>. Any argument entered after the alias will be inserted at the brackets. ALIAS <name> displays the <string> for that alias. ALIAS alone lists all current aliases. Aliases are local to the Shell in which they are defined. If you create another Shell with the NEWSHELL command, it will share the same aliases as its parent Shell. However, if you create another Shell with the Execute Command menu item (from the Workbench menuline), it will not recognize aliases created in your original Shell. To create a global alias that will be recognized by all Shells, insert the alias in the Shell-startup file. To remove an ALIAS, use the UNALIAS command. Example 1: 1> ALIAS d1 DIR DF1: Entering d1 results in a directory of the contents of the disk in DF1:, just as if you had entered DIR DF1:. Example 2: 1> ALIAS hex TYPE [] HEX NUMBER Creates an alias called hex that displays the contents of a specified file in hexadecimal format. The brackets indicate where the filename will be inserted. If you then entered: 1> hex Myfile The contents of Myfile would be displayed in hexadecimal format with line numbers. See also: UNALIAS


Converted from AmigaGuide format to basic HTML by Jaruzel.