Morisot Help Pages: alias

Morisot Help Pages:

alias

Last updated on Thu Oct 1 in 1998



NAME:        alias - set an alias or show the list of aliases

SYNOPSIS:    alias [echo on]|[echo off]|[<cmd> [<to what>]]

DESCRIPTION: The alias command allows you to define a limited list of
             aliases (abbreviations) for commands to make them easier 
             to type.

             Just typing 'alias' will show you the list of definitions,
             including the aliases that are already predefined by the
             system. (You cannot change those.)
             'alias bla' will show you if the alias 'bla' exists and
             what it stands for.
             (Example 1)

             'alias echo on' and 'alias echo off' will put you into
             an echo mode or out of it. Echo mode means that all expanded
             commands are shown before execution.

             To define a new alias (or redefine an existing one), you
             type more than one word after 'alias'. Then the first word
             after 'alias' is the alias, and the rest is the command which
             it stands for.
             By default, the mud puts an '%*' after each alias definition,
             except when you use wildcards yourself. (See below.)
             (Example 2)

             You use an alias by just typing it, like a command.
             If you type anything after the alias, it is appended to the
             command automatically. This is done by the '%*' at the end of
             the alias definition. (So if you set your own wildcards and
             therefore there is no '%*' at the end, nothing will be
             appended behind the alias.)
             (Example 2)

             You can use wildcards in alias definitions. They represent
             parts of the text which you type after the alias when you use
             it.
             - %1, %2, %3, etc. stand for the first (second, third,
               etc.) word after the alias;
             - %-1, %-2, %-3, etc. stand for the last (last but one,
               last but two, etc.) word after the alias;
             - %* stands for the rest, that is, for all the text that
               isn't already referred to by using %<nr> or %-<nr>.
             There MUST be spaces before and behind %<nr>, %-<nr> and %*.
             Otherwise it will lead to a bug.
             If a wildcard represents a word that isn't there (e.g. %3
             when there are only two words), it returns the empty
             string, that is, nothing.
             (Examples 2 - 4)
             
             An alias can also define a whole sequence of commands,
             instead of only one command. The commands of the sequence
             must be separated by a ';'. They will be executed with a
             delay of 1 second between.
             Note that you can't use aliases within an alias sequence. 
             (Examples 5 and 6)

EXAMPLE:     Example 1: Check existing aliases
                 alias
                 alias xyz

             Example 2: Set and use an alias without wildcards
             Set it:
                 alias gr grin ulysses
             Then alias 'wh' is set to 'emote whistles %*'.
             Use it:
                 wh
             executes:
                 emote whistles
             Another use:
                 wh a catchy tune.
             executes:
                 emote whistles a catchy tune.

             Example 3: A simple alias with wildcards
                 alias wi wield %* in %-1 hand
                 wi orcish saber left
             The system substitutes:
             %-1 = last word = "left"
             %*  = rest      = "orcish saber"
             So the executed command is:
                 wield orcish saber in left hand

             Example 4: Another example with wildcards
             Set it:
                 alias xy emote bops %-5 and %37 tells %6 that %*
             Use it:
                 xy this is Ulysses just another Sheiligh example.
             What it does:
                 emote bops Ulysses and tells Sheiligh that this is
                   just another example.

             Example 5: A command sequence
             Set it:
                 alias test say testing;emote %1 ; %2 ;say ok
             Use it:
                 test wobbles. bounce
             What it does:
                 say testing
                 emote wobbles.
                 bounce
                 say ok

             Example 6: What is not allowed
                 alias loop emote runs around in circles;loop

NOTE:        An alias stands for a command or a sequence of commands.
             You can not redefine one of the system aliases.
             You can use wildcards in the alias definition. They refer
             to what you type behind the alias when you use it.
             When you use an alias, everything you type behind it is
             appended to the command, but only if you didn't define your
             own wildcards.
             Before and after a wildcard, there must be a space.

SEE ALSO:    unalias



This page hosted by GeoCities Get your own Free Home Page

Help | Morisot Page | Birgit's Home Page | Visit TimesSquare/Stadium | Explore GeoCities

1