HP 3000 Manuals

ALIAS [ System Debug Reference Manual ] MPE/iX 5.0 Documentation


System Debug Reference Manual

ALIAS 

Defines an alias (alternative) name for a command or macro.

Syntax 

      ALIAS name command 

Aliases are useful for defining a new (shorter or longer) name for a
command name or macro name.  Aliases have higher precedence than command
or macro names, and they can therefore be used to redefine (or conceal)
commands or macros.  When a new alias redefines a command, a warning is
generated, indicating that a command has been hidden.

User defined aliases, created with the ALIAS command, are classified as
user aliases.  Several predefined aliases (command abbreviations) are
automatically generated, and are classified as predefined aliases.  Refer
to the ALIASLIST and ALIASINIT commands.

Parameters 

 name            The name of the alias (the new name to be used in place
                 of another).  Alias names are restricted to 16
                 characters.

 command         The command name to be used when the alias name is
                 encountered.  This can be any command or macro name.
                 The command name is restricted to 32 characters.

Examples 

     $nmdebug > printtableentrylength 6 
     $200
     $nmdebug > alias tbl printtableentrylength 
     $nmdebug > tbl 6 
     $200

The above example assumes that a macro called printtableentrylength has
been defined, and a typical macro invocation is displayed.  Since the
macro name is long, and difficult to enter, an alias named TBL is
defined.  The shorter alias name can now be used in place of the longer
macro name.

     $nmdebug > alias loop foreach 
     $nmdebug > loop j '1 2 3' {wl j} 
     $1
     $2
     $3

Create an alias named LOOP that is the same as the FOREACH command.

     $nmdat > macro concealexit { wl "type EXIT to exit."} 
     $nmdat > alias e concealexit 
     A command is hidden by this new alias.  (warning #71)
     $nmdat > e 
     type EXIT to exit.

In this example, the single character command e (for EXIT) is protected
by an alias, that conceals (hides) the original command.  Note that a
warning message is generated whenever a command name is concealed by an
alias definition.

     $nmdat > alias one two 
     $nmdat > alias two three 
     $nmdat > alias three one 
     $nmdat > one 
     Circular ALIAS error.  Recursive ALIAS definition(s).  (error #2445)

It is legal for an alias (for example, one in the example above) to refer
to another alias (two in the example above), so long as the chain of
aliases does not wrap back onto itself.  Recursive aliases are detected,
and an error is generated.

     $nmdat > alias showtime "wl time" 
     $nmdat > aliasl showtime 
     alias showtime wl time   /* user
     $nmdat > showtime 
     Unknown command.  (error #6105)
        Command "showtime" was aliased to "wl time".

Note that alias command names are restricted to simple command or macro
names.  In the above example, the command wl time was assumed to be the
name of a command or macro.  Since no match was found in the command or
macro table, an error is generated.  Macros should be used when more
complex command lists or commands with parameters are desired.

Related commands:  ALIASINIT, ALIASL, ALIASD.

Limitations, Restrictions 

A maximum of 60 alias definitions are currently supported.

The alias command (the replacement name) is limited to command and macro
names; no parameters or complex command lists are allowed.  Refer to the
showtime example above.

The ALIASD command cannot be aliased.

No testing is performed for invalid characters within the name or command 
parameters.


CAUTION The output format of all System Debug commands is subject to change without notice. Programs that are developed to postprocess System Debug output should not depend on the exact format (spacing, alignment, number of lines, uppercase or lowercase, or spelling) of any System Debug command output.


MPE/iX 5.0 Documentation