You can create aliases to execute any ExtremeXOS command, including any options, arguments, and redirection.
For example, you can create an alias called "download" to
substitute for "
download image 220.127.116.11". Now
you can now simply type "download" and then the image file name to download your ExtremeXOS image
from the 18.104.22.168 location, instead of typing
image 22.214.171.124 image_name.
Aliases are only available in the shell session in which they are created. When you exit the shell your aliases are lost. To create persistent aliases, you need to add the aliases to the script exshrc.xsf that you must create using the VI editor and save in the /usr/local/cfg folder.
For more information about the exshrc.xsf script, see ExtremeXOS Shell RC Script. For information about managing files on the switch, see Using the ExtremeXOS File System.
To be recognized, the alias must be the first word in the command string typed at the prompt. Substitution does not occur if the alias name string occurs anywhere else.
Auto-completion works for aliases much as it does for ExtremeXOS commands (see Syntax Helper).
- Arguments cannot occur in the middle of alias commands. For example, you cannot create an alias "set_vlan_ip" for the command configure vlan vlan_name ipaddress ip_address where you specify the VLAN name as an argument. This is because aliases work through direct textual substitution.
- Aliases cannot be chained together. For example, if you create an alias "sh" for show
version and another alias "ps" for process, then entering
sh psat the prompt is not equivalent to entering “
show version process”.
- You cannot tab-complete commands when creating an alias by using the alias command.
- Aliases cannot be created for the current shell session using UPM scripts or Python scripts.
- Tab completion does not work for commands given inside the aliases.
To create an alias, use the command alias alias_name command
To view a list of current aliases, use the command alias (with no other arguments).
To display the command that will be substituted for alias_name, use the command alias alias_name.
To delete aliases, use the command unalias.