Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

ALIAS Internal
Purpose: To set or display command aliases.
Format: ALIAS [<name>] [<string>]
Template: NAME, STRING/F
Path: Internal
ALIAS enables 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:

3.OS4:> NEWSHELL WINDOW=CON:0/250/640/150/2SHELL/CLOSE" the WINDOW argument cannot be replaced with an alias. Similarly in the following command line: 3.OS4:> 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 arguments entered after the alias will be inserted in 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 NEWCLI or NEWSHELL commands, it will share the same aliases as its parent Shell. However, if you create another Shell with the 'Execute command' menu item, it will not recognise aliases created in your original Shell. To create a global alias that will be recognised by all Shells, insert the alias in the Shell-startup file.

To remove an ALIAS, use the UNALIAS command.

Example 1:

3.OS4:> ALIAS d1 DIR DF1:
entering d1 results in a directory of the contents of the disk in DF1: being displayed, just as if you had entered DIR DF1:.

Example 2:

3.OS4:> ALIAS hex type [] HEX NUMBER
creates an alias call hex that displays the contents of a specified file in hexadecimal format. The brackets indicate where the filename will be inserted. If you the entered: 3.OS4:> hex Myfile
the contents of Myfile would be displayed in hexadecimal format with line numbers.

See also: UNALIAS


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.