Creates aliases to execute any ExtremeXOS command, including any options, arguments, and redirection.
|alias_name||Specifies an alias name for the command.|
|command||ExtremeXOS command that you are creating an alias for.|
To be recognized, the alias must be the first word in the string typed at the shell prompt. Substitution does not occur if the alias name string occurs anywhere else. Aliases are only recognized by the EXSH shell session in which they are created.
Executing the command alias (with no other arguments) displays a list of current aliases. Executing the command alias alias_name displays the command that will be substituted for alias_name.
To delete aliases, use the command unalias.
After an alias has been created, you can auto-complete the alias name or display possible aliases along with regular commands by pressing the TAB key. You can tab-complete arguments that follow commands corresponding to an alias.
Creating an alias using the name of an existing ExtremeXOS command
overrides the original meaning of that command. For example, executing
alias download "download image 126.96.36.199" allows
you to simply type download image_name to download your ExtremeXOS image
from the 188.8.131.52 location . However, if you then want to download a bootrom file, the
command download bootrom 184.108.40.206filename no longer functions correctly. Such
an alias can be disabled temporarily and the original command behavior restored by preceding
it directly (with no spaces in between) with a backslash, \download bootrom 220.127.116.11filename This
temporarily overrides the alias definition and uses the original command.
To create an alias for a command that contains quoted strings within it,
use a backslash. For example, if creating an alias "cr" for the command
configure vlan default description "This is the default
VLAN", use the command
"configure vlan default description \"This is the default VLAN\"".
- 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 while trying to create an alias using the alias command.
- Aliases cannot be created for the current shell session using UPM scripts or Python scripts.
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.
The following example creates an alias named "set" for configure commands:
alias set "configure"
You can now substitute the command set for all configure commands. For example, you can type set vlan vlan_name tag tag instead of configure vlan vlan_name tag tag.
alias mycmd "configure policy profile 1 name Extreme pvid 1000 pvid-status enable tci-overwrite enable auth-override enable forbidden-vlans 2 cos-status enable cos 2 untagged-vlans 2 egress-vlans 200"
executes the command
configure policy profile 1 name
Extreme pvid 1000 pvid-status enable tci-overwrite enable auth-override enable
forbidden-vlans 2 cos-status enable cos 2 untagged-vlans 2 egress-vlans 200
alias alias mycmd='configure policy profile 1 name Extreme pvid 1000 pvid-status enable tci-overwrite enable auth-override enable forbidden-vlans 2 cos-status enable cos 2 untagged-vlans 2 egress-vlans 200' alias set='configure'
This command was first available in ExtremeXOS 22.3
This command is available on ExtremeSwitching 5320, 5420, 5520, and 5720 series switches.