enable cli history expansion

enable cli history expansion {session | permanent}

Description

Performs command line history expansion similar to the Linux shell.

Syntax Description

cli Command line interface settings.
history Command history settings.
expansion Substitute occurrences of '!n:w' with the corresponding line 'n' and word 'w+1' from command history (default disabled).
session Configures history expansion for this CLI session only (default ).
permanent Configures history expansion for this CLI session, and all future sessions.

Default

CLI history expansion is disabled by default. If not specified when enabling, CLI history expansion is enabled for the current session only.

Usage Guidelines

The history expansion character ‘!‘ can be used to specify command from the history that is substituted into the command line. All occurrences of the form “!n:w” in the command are replaced with the w‘th word from the n'th line in the command history. Specification of the word is optional.

If you enable CLI history expansion, and then try to reference a history that does not exist, the following error appears:
# show !58:1 Error: History event not found. If you were not attempting a history expansion using the format '!n:w', and believe the command to be valid, please retry the command after 'disable cli history expansion'. 

To view the status of CLI history expansion on the switch, use the show management command.

Example

The following command enables CLI history expansion for this session and all future sessions:

enable cli history expansion permanent

History

This command was first available in ExtremeXOS 30.2.

Platform Availability

This command is available on the ExtremeSwitching X435, X440-G2, X450-G2, X460-G2, X465, X590, X620, X670-G2, X690, X695, and X870 series switches.