38
805
command creates a CLI help string with the keywords for the macro. The
help string will be displayed if help on the macro is requested from the
macro and macro global commands. The GUI also uses the keywords
specified in the command as the parameter names for the macro. See
Example 2 and 3 below for a description of how this command is used in
the CLI.
The syntax for this preprocessor command is as follows:
#macro keywords $
where $keywordn is the name of the keyword.
Editing a Macro
Macros cannot be edited. Modify a macro by creating a new macro with the same
name as the existing macro. The newer macro overwrites the existing macro.
The exceptions to this are the built-in macros and corresponding anti-macros for
the Smartport feature. You cannot override a Smartport macro. To change a
Smartport macro, create a new macro (my_macro) and an anti macro
(no_my_macro) and associate it with the Smartport type using the
smartport macro
command.
Scope of Macro
It is important to consider the scope of any user-defined macro. Because of the
potential hazards of applying unintended configurations, do not change
configuration modes within the macro by using commands such as exit, end, or
interface-id
interface
macros in the various configuration modes. Macros may be executed in Privileged
Exec mode, Global Configuration mode, and Interface Configuration mode (when
the interface is NOT a VLAN.)
Examples
Example 1 -The following example shows how to create a macro that configures
the duplex mode of a port.
switchxxxxxx(config)#
Enter macro commands one per line. End with the character '@'.
#macro description dup
duplex full
negotiation
keyword1
keyword2
$
. With a few exceptions, there are other ways of executing
macro name dup
Cisco Sx350 Ph. 2.2.5 Devices - Command Line Interface Reference Guide
Macro Commands
keyword3
$
macro auto user