Knowledge Search


×
 

[ScreenOS] How to create aliases

  [KB12290] Show Article Properties


Summary:

The purpose of this article is to provide instructions for creating aliases for the ScreenOS command line interface.

Symptoms:

ScreenOS is capable of using alias commands similar to that found in most Linux command line shells. Aliases can be used to create a shorthand command for longer, more complex commands that are used repeatedly.

Solution:

To create an alias for a command, log into the command line via the console port or SSH/Telnet.

Use the command:

set alias <alias command> <full command>

Example:

set alias db "get db stream"

The example above creates an alias called "db". When "db" is entered on the command line the command "get db stream", which retrieves the contents of the debug buffer, is executed.

Another example of using aliases is documented here below:-

You can use a 'show' command to display the equivalent of a 'get' command using the 'set alias' command. 

Example:

NS-> set alias ?
<string>             alias name (up to 16 characters)
NS-> set alias show ?
<string>             alias definition
NS-> set alias show get
NS-> show db str
DHCP: Read 52 bytes from large file
DHCP: Interface trust has 1 IPs
DHCP: Current time 4454888; saved time 4454810; elapsed time 78
DHCP: saved entry 0: 20.20.20.20 - 0000399fe419 - 4294967295 (committed, lease time remained 1440000)
## 16:08:24 : UF CPA DNS callback: in
## 16:08:24 : UF CPA DNS callback: state change to CPA_STATE_COMPLETE
## 16:08:24 : UF CPA DNS callback: in
## 16:08:24 : UF CPA DNS callback: state change to CPA_STATE_COMPLETE
NS-> show conf | i alias
set alias show "get"
NS->     

Modification History:
2019-10-05: Added example.
Related Links: