One of the most useful features of Zoom Shell is that you can create aliases to run applications or run commands for you. For example, you may wish to create an alias for Alta Vista as follows:
av (alias for) browse http://www.altavista.digital.com
When you type in av, Zoom Shell will use the alias browse to open a web browser and tell that web browser to go to Alta Vista.
Entering and modifying Aliases:
Zoom Shell makes it easy to enter aliases in five ways:
1) Automatic Detection at Setup: During setup, Zoom Shell tried to find several well-known applications, such as your default browser, default text editor, and default word processor. It also set up a few aliases for convenience.
2) Alias Editor: Zoom Shell provides an editor for entering, modifying and deleting aliases. You can get to this by choosing "Options|Aliases" on the Zoom Shell menu.The alias editor sorts aliases and makes it easy to edit them. However, it does not perform validation on them. You can enter duplicate or invalid aliases.
You may enter comments in the alias file by starting a line with ";".
3) Command Line: The alias command adds aliases, or overwrites old aliases with new ones. The unalias command removes aliases from Zoom Shell's memory and from the alias file.
- alias av browse http://www.altavista.digital.com
To enter an alias which has ";" or "&&", enclose the alias with quotes:
- alias useless "copy c:\* d:\temp;dir d:\temp;del d:\temp"
4) Finding Executables: Zoom Shell has a facility for guessing aliases under "Options|Setup" on the command line menu. Just point it to a directory that commands are likely to be in, and press the "Search" button.
5) Drag and Drop: You can also drag and drop files into the alias window. An alias will then be created for you automatically.
Zoom Shell commands conflicting with system commands:
Zoom Shell has a number of built-in commands, some of which might conflict with a command which you have on your system. You will find that Zoom Shell executes its own version of a command before it executes others. There are three ways to run the system command if you so choose. The first, is if that command is actually an alias (as in al, e, or ls), you can delete or rename the alias. Second, you can create an alias for you own executable:
This creates an alias for an executable called kill.exe, allowing your executable and Zoom Shell's kill command to co-exist. Last, you can create an alias which allows your executable to run with its own name:
This method disables Zoom Shell's command, because aliases are resolved before commands are run.
Parameters (see also: environment)
You can use aliases with many applications to open documents. The alias "word" for Microsoft Word can be used with a file name, so that Word will open that file:
word MonthlyReport.doc notepad ReadMe.txt ftp ftp.microsoft.com
You can also make an alias work like a batch file, passing in numbered parameters. This is a little more complicated. Take, for instance, the command line used to make a self extracting executable with unzipsfx.exe:
copy /b c:\utils\unzipsfx.exe+filename.zip filename.exe
Let's make an alias for that command (use the alias editor for this!!):
zip2exe copy /b c:\utils\unzipsfx.exe+${1}.zip ${1}.exe;#
When Zoom Shell parses the command line, it will substitute the "${1}" with the first argument to the alias. Suppose we want to make a self-extracting executable, "zoom.exe," from the zip file, "zoom.zip." Here is our command line:
zip2exe zoom
Zoom Shell will insert the word "zoom" in each occurance of "${1}" and then remove "zoom" from the tail end of the command line. You can use 10 parameters; 0 for the command itself; 1-9 for each of the parameters. Here is the parsed form of the command:
copy /b c:\utils\unzipsfx.exe+zoom.zip zoom.exe
Note that this method will only work on the command line. In a script, the positional parameters are set by the command line that called the script. Furthermore, the positional parameters might stay around after the script has completed, depending on configuration. Please see the scripting help on the web for further details. The comment, ";#", is very important, because it "trims" the positional parameter off the line.
You can use the command aliaslist (or the alias al) to display your aliases. Type al to get a list of all your aliases, or al plus some text to search for that text. For example, al http will search for all aliases containing the string, http. The search is not case sensitive.
If you type al with only one letter, it will give you two lists. The first is all the aliases begining with that letter. The second is all the aliases containing that letter.