Configuring Cli Variables; About Cli Variables; Configuring Cli Session-Only Variables - Cisco MDS 9000 Series Configuration Manual

Hide thumbs Also See for MDS 9000 Series:
Table of Contents

Advertisement

Understanding the Command-Line Interface
timeout value:1
deadtime value:1
total number of servers:1
following RADIUS servers are configured:
This example shows how to use the no form of a command in EXEC mode:
switch# cli var name testinterface ethernet1/2
switch# show cli variables
SWITCHNAME="switch"
TIMESTAMP="2009-05-12-13.43.13"
testinterface="ethernet1/2"
switch# cli no var name testinterface
switch# show cli variables
SWITCHNAME="switch"
TIMESTAMP="2009-05-12-13.43.13"

Configuring CLI Variables

This section describes CLI variables in the Cisco NX-OS CLI.

About CLI Variables

The Cisco NX-OS software supports the definition and use of variables in CLI commands.
You can refer to CLI variables in the following ways:
• Entered directly on the command line.
• Passed to a script initiated using the run-script command. The variables defined in the parent shell are
CLI variables have the following characteristics:
• Cannot have nested references through another variable
• Can persist across switch reloads or exist only for the current session
Cisco NX-OS supports one predefined variable: TIMESTAMP. This variable refers to the current time when
the command executes in the format YYYY-MM-DD-HH.MM.SS.
Note
The TIMESTAMP variable name is case sensitive. All letters must be uppercase.

Configuring CLI Session-Only Variables

You can define CLI session variables to persist only for the duration of your CLI session. These variables are
useful for scripts that you execute periodically. You can reference the variable by enclosing the name in
parentheses and preceding it with a dollar sign ($), for example $(variable-name).
OL-29291-02
10.10.1.1:
available for authentication on port:1812
available for accounting on port:1813
available for use in the child run-script command process.
Cisco MDS 9000 Family NX-OS Fundamentals Configuration Guide
Configuring CLI Variables
47

Advertisement

Table of Contents
loading

Table of Contents