2. CLI usage

This chapter provides information about using the command-line interface (CLI).

2.1. CLI structure

Nokia’s Operating System (OS) CLI is a command-driven interface accessible through the console, Telnet, and secure shell (SSH). The CLI can be used for configuration and management of routers.

The CLI command tree is a hierarchical inverted tree. At the highest level is the ROOT level. Below this level are other tree levels with the major command groups; for example, configuration commands and show commands are levels below ROOT.

The CLI is organized so related commands with the same scope are at the same level or in the same context. Sublevels or subcontexts have related commands with a more refined scope.

The following figures show the major contexts for router configuration. The figures are sample representations of high-level commands; not all commands are included.

Figure 1:  Root commands 
Figure 2:  Operational root commands 

2.2. Navigating in the CLI

The following sections describe additional navigational and syntax information.

2.2.1. CLI contexts

Use the CLI to access, configure, and manage Nokia’s 7210 SAS devices. CLI commands are entered at the command line prompt. Access to specific CLI commands is controlled by the permissions set by your system administrator. Entering a CLI command makes navigation possible from one command context (or level) to another.

When you initially enter a CLI session, you are in the ROOT context. Navigate to another level by entering the name of successively lower contexts. For example, enter either the configure or show commands at the ROOT context to navigate to the config or show context, respectively. For example, at the command prompt, enter config. The active context displays in the command prompt.

A:ALU-7210# config
A:ALU-7210>config#

In a CLI context, you can enter commands at that context level by entering the text. It is also possible to include a command in a lower context as long as the command is formatted in the correct command and parameter syntax.

The following example shows two methods to navigate to a service SAP ingress level:

Method 1:

A:ALU-7210# config service epipe 6 sap 1/1/2 ingress

Method 2:

A:ALU-7210# configure
A:ALU-7210>config# service
A:ALU-7210>config>service# epipe 6
A:ALU-7210>config>service>epipe# sap 1/1/2
A:ALU-7210>config>service>epipe>sap# ingress
A:ALU-7210>config>service>epipe>sap>ingress#

The CLI returns an error message when the syntax is incorrect.

A:ALU-7210>config>service>epipe# sapp
                                 ^
Error: Bad command.
A:ALU-7210>config>service>epipe#

2.2.2. Basic CLI commands

The console control commands are the commands that are used for navigating within the CLI and displaying information about the console session. Most of these commands are implemented as global commands. They can be entered at any level in the CLI hierarchy with the exception of the password command which must be entered at the ROOT level. The following table describes the console control commands.

Table 5:  Console control commands  

Command

Description

<Ctrl-c>

Aborts the pending command.

<Ctrl-z>

Terminates the pending command line and returns to the ROOT context.

back

Navigates the user to the parent context.

clear

Clears statistics for a specified entity or clears and resets the entity.

echo

Echos the text that is typed in. Primary use is to display messages to the screen within an exec file.

exec

Executes the contents of a text file as if they were CLI commands entered at the console.

exit

Returns the user to the previous higher context.

exit all

Returns the user to the ROOT context.

help

?

Displays help in the CLI.

history

Displays a list of the most recently entered commands.

info

Displays the running configuration for a configuration context.

logout

Terminates the CLI session.

oam

Provides OAM test suite options. Refer to “OAM and SAA” in the 7210 SAS-D, Dxp, K 2F1C2T, K 2F6C4T, K 3SFP+ 8C OAM and Diagnostics Guide for more information about OAM test suite options.

password

Changes the user CLI login password. The password can only be changed at the ROOT level.

ping

Verifies the reachability of a remote host.

pwc

Displays the present or previous working context of the CLI session.

sleep

Causes the console session to pause operation (sleep) for one second or for the specified number of seconds. Primary use is to introduce a pause within the execution of an exec file.

ssh

Opens a secure shell connection to a host.

telnet

Telnet to a host.

traceroute

Determines the route to a destination address.

tree

Displays a list of all commands at the current level and all sublevels.

write

Sends a console message to a specific user or to all users with active console sessions.

The list of all system global commands is displayed by entering help globals in the CLI. For example:

A:ALU-7210>config>service# help globals
      back            - Go back a level in the command tree
      echo            - Echo the text that is typed in
      enable-admin    - Enable the user to become a system administrator
      exec            - Execute a file - use -echo to show the commands and
                        prompts on the screen
      exit            - Exit to intermediate mode - use option all to exit to
                        root prompt
      help            - Display help
      history         - Show command history
      info            - Display configuration for the present node
      logout          - Log off this system
      oam             + OAM Test Suite
      ping            - Verify the reachability of a remote host
      pwc             - Show the present working context
      sleep           - Sleep for specified number of seconds
      ssh             - SSH to a host
      telnet          - Telnet to a host
      traceroute      - Determine the route to a destination address
      tree            - Display command tree structure from the context of
                        execution
      write           - Write text to another user
A:ALU-7210>config>service#

The following table describes command syntax symbols.

Table 6:  Command syntax symbols  

Symbol

Description

|

A vertical line indicates that one of the parameters within the brackets or braces is required.

tcp-ack {true | false}

[ ]

Brackets indicate optional parameters.

redirects [number seconds]

< >

Angle brackets in the CLI indicate that you must enter text based on the parameter inside the brackets (in the 7210 SAS manuals, italics are used to indicate the same rule.

interface <interface-name>

{ }

Braces indicate that one of the parameters must be selected.

default-action {drop | forward}

[{ }]

Braces within square brackets indicates that you must choose one of the optional parameters.

sdp sdp-id [{mpls}] vpls service-id [svc-sap-type {null-star|dot1q|dot1q-preserve}]

Bold

Commands in bold indicate commands and keywords.

Italic

In the 7210 SAS manuals, commands in italics indicate parameters that you must enter a value for.

2.2.3. CLI environment commands

The CLI environment commands are found in the root>environment context of the CLI tree and control session preferences for a single CLI session. The following table describes the CLI environment commands.

Table 7:  CLI environment commands  

Command

Description

alias

Enables the substitution of a command line by an alias.

create

Enables or disables the use of a create parameter check.

more

Configures whether CLI output should be displayed one screen at a time awaiting user input to continue.

reduced-prompt

Configures the maximum number of higher-level CLI context nodes to display by name in the CLI prompt for the current CLI session.

saved-ind-prompt

Saves the indicator in the prompt.

terminal

Configures the terminal screen length for the current CLI session.

time-display

Specifies whether time should be displayed in local time or UTC.

2.2.4. CLI monitor commands

Monitor commands display specified statistical information related to the monitor subject (such as filter, port, QoS, router, service) at a configurable interval until a count is reached. The CLI monitor commands are found in the root>monitor context of the CLI tree.

The monitor command output displays a snapshot of the current statistics. The output display refreshes with subsequent statistical information at each configured interval and is displayed as a delta to the previous display.

The <Ctrl-c> keystroke interrupts a monitoring process. Monitor command configurations cannot be saved. You must enter the command for each monitoring session. Note that if the maximum limits are configured, you can monitor the statistical information for a maximum of 60 * 999 sec ~ 1000 minutes.

The following table describes the CLI monitor command contexts.

Table 8:  CLI monitor command contexts 

Command

Description

filter

Enables IP, IPv6, and MAC filter monitoring at a configurable interval until that count is reached.

lag

Enables Link Aggregation Group (LAG) monitoring to display statistics for individual port members and the LAG.

port

Enables port traffic monitoring. The specified ports statistical information displays at the configured interval until the configured count is reached.

service

Monitors commands for a particular service.

2.3. Getting help in the CLI

The help system commands and the ? key display different types of help in the CLI. The following table describes the different help commands.

Table 9:  Online help commands  

Command

Description

help ?

List all commands in the current context.

string ?

List all commands available in the current context that start with string.

command ?

Displays the command syntax and associated keywords.

command keyword ?

List the associated arguments for keyword in command.

string<Tab>

Complete a partial command name (auto-completion) or list available commands that match string.

The tree and tree detail system commands are help commands useful when searching for a command in a lower-level context.

The following example displays a partial list of the tree and tree detail command output entered at the config level.

A:ALU-7210>config# tree
configure
+---card
|   +---card-type
|   +---mda
|   |   +---access
|   |   +---mda-type
|   |   +---network
|   |   +---shutdown
|   +---shutdown
+---cron
|   +---action
|   |   +---expire-time
|   |   +---lifetime
|   |   +---max-completed
|   |   +---results
|   |   +---script
|   |   +---shutdown
|   +---schedule
|   |   +---action
|   |   +---count
|   |   +---day-of-month
|   |   +---description
|   |   +---end-time
|   |   +---hour
|   |   +---interval
|   |   +---minute
|   |   +---month
|   |   +---shutdown
|   |   +---type
|   |   +---weekday
|   +---script
|   |   +---description
|   |   +---location
|   |   +---shutdown
|   +---time-range
|   |   +---absolute
|   |   +---daily
|   |   +---description
|   |   +---weekdays
|   |   +---weekend
|   |   +---weekly
|   +---tod-suite
|   |   +---description
|   |   +---egress
|   |   |   +---filter
|   |   |   +---qos
|   |   |   +---scheduler-policy
|   |   +---ingress
|   |   |   +---filter
|   |   |   +---qos
|   |   |   +---scheduler-policy
+---dot1ag
|   +---domain
|   |   +---association
|...
*A:ALA-12>config# tree detail
configure
+---card <slot-number>
|   no card <slot-number>
|   +---card-type <card-type>
|   |   no card-type
|   +---mda <mda-slot>
|   |   no mda <mda-slot>
|   |   +---access
|   |   +---mda-type <mda-type>
|   |   |   no mda-type
|   |   +---network
|   |   +---no shutdown
|   |   |   shutdown
|   +---no shutdown
|   |   shutdown
+---cron
|   +---action <action-name> [owner <action-owner>]
|   |   no action <action-name> [owner <action-owner>]
|   |   +---expire-time {<seconds>|forever}
|   |   +---lifetime {<seconds>|forever}
|   |   +---max-completed <unsigned>
|   |   +---no results
|   |   |   results <file-url>
|   |   +---no script
|   |   |   script <script-name> [owner <script-owner>]
|   |   +---no shutdown
|   |   |   shutdown
|   +---no schedule <schedule-name> [owner <schedule-owner>]
|   |   schedule <schedule-name> [owner <schedule-owner>]
|   |   +---action <action-name> [owner <action-owner>]
|   |   |   no action
|   |   +---count <number>
|   |   |   no count
|   |   +---day-of-month {<day-number> [..<day-number>]|all}
|   |   |   no day-of-month
|   |   +---description <description-string>
|   |   |   no description
|   |   +---end-time [<date>|<day-name>] <time>
|   |   |   no end-time
|   |   +---hour {<hour-number> [..<hour-number>]|all}
|   |   |   no hour
|   |   +---interval <seconds>
|   |   |   no interval
| |   +---minute {<minute-number> [..<minute-number>]|all}
|   |   |   no minute
|   |   +---month {<month-number> [..<month-number>]|<month-name> [..<month-nam>]|all}
|   |   |   no month
|   |   +---no shutdown
|   |   |   shutdown
|   |   +---type <schedule-type>
|   |   +---weekday {<weekday-number> [..<weekday-number>]|<day-name> [..<day-nme>]|all}
|...

2.4. The CLI command prompt

By default, the CLI command prompt indicates the device being accessed and the current CLI context. For example, the prompt: A:ALA-1>config>router>if# indicates the active context, the user is on the device with hostname ALA-1 in the configure>router>interface context. In the prompt, the separator used between contexts is the “>” symbol.

At the end of the prompt, there is either a pound sign (“#”) or a dollar sign (“$”). A “#” at the end of the prompt indicates the context is an existing context. A “$” at the end of the prompt indicates the context has been newly created. New contexts are newly created for logical entities when the user first navigates into the context.

Since there can be a large number of sublevels in the CLI, the environment command reduced-prompt no of nodes in prompt allows the user to control the number of levels displayed in the prompt.

All special characters (#, $, etc.) must be enclosed within double quotes, otherwise it is seen as a comment character and all characters on the command line following the # are ignored. For example:

*A:ALU-7210>config>router# interface "primary#1"

When changes are made to the configuration file a “*” appears in the prompt string (*A:ALU-7210) indicating that the changes have not been saved. When an admin save command is executed the “*” disappears. This behavior is controlled in the saved-ind-prompt command in the environment context.

2.5. Displaying configuration contexts

The info and info detail commands display configuration for the current level. The info command displays non-default configurations. The info detail command displays the entire configuration for the current level, including defaults. The following example shows the output that displays using the info command and the output that displays using the info detail command.

*A:ALA>config>service>vpls# info 
----------------------------------------------
            stp
                shutdown
            exit
            sap 1/1/14:100 create
            exit
            sap 1/1/15:100 create
            exit
            no shutdown
----------------------------------------------
*A:ALA>config>service>vpls# info detail 
----------------------------------------------
            no description
            no disable-learning
            no disable-aging
            no discard-unknown
            fdb-table-size 250
            fdb-table-high-wmark 95
            fdb-table-low-wmark 90
            local-age 300
            stp
                shutdown
                priority 32768
                hello-time 2
                forward-delay 15
                max-age 20
                hold-count 6
                mode rstp
            exit
            mac-move
                move-frequency 2
                retry-timeout 10
                shutdown
            exit                      
            sap 1/1/14:100 create
                no description
                no tod-suite
                limit-mac-move blockable
                no disable-aging
                no max-nbr-mac-addr
                no discard-unknown-source
                no mac-pinning
                stp
                    path-cost 10
                    priority 128
                    no edge-port
                    auto-edge
                    link-type pt-pt
                    no root-guard
                    no shutdown
                exit
                dot1ag
                exit
                no authentication-policy
                no l2pt-termination
                no bpdu-translation 
                ingress               
                    qos 1 
                    no match-qinq-dot1p
                    no filter
                exit
                egress
                    no qinq-mark-top-only
                    no filter
                    no agg-rate-limit
                exit
                no collect-stats
                no accounting-policy
                no shutdown
            exit
            sap 1/1/15:100 create
                no description
                no tod-suite
                limit-mac-move blockable
                no disable-aging
                no max-nbr-mac-addr
                no discard-unknown-source
                no mac-pinning
                stp
                    path-cost 10      
                    priority 128
                    no edge-port
                    auto-edge
                    link-type pt-pt
                    no root-guard
                    no shutdown
                exit
                dot1ag
                exit
                no authentication-policy
                no l2pt-termination
                no bpdu-translation 
                ingress
                    qos 1 
                    no match-qinq-dot1p
                    no filter
                exit
                egress
                    no qinq-mark-top-only
                    no filter
                    no agg-rate-limit
                exit
                no collect-stats      
                no accounting-policy
                no shutdown
            exit

2.6. EXEC files

The exec command allows you to execute a text file of CLI commands as if it were typed at a console device.

The exec command and the associated exec files can be used to conveniently execute a number of commands that are always executed together in the same order. For example, an exec command can be used by a user to define a set of commonly used standard command aliases.

The echo command can be used within an exec command file to display messages on screen while the file executes.

2.7. Entering CLI commands

2.7.1. Command completion

The CLI supports both command abbreviation and command completion. If the keystrokes entered are enough to match a valid command, the CLI displays the remainder of the command syntax when the <Tab> key or space bar is pressed. When typing a command, the <Tab> key or space bar invokes auto-completion. If the keystrokes entered are definite, auto-completion will complete the command. If the letters are not sufficient to identify a specific command, pressing the <Tab> key or space bar will display commands matching the letters entered. System commands are available in all CLI context levels.

2.7.2. Unordered parameters

In a context, the CLI accepts command parameters in any order as long as the command is formatted in the correct command keyword and parameter syntax. Command completion will still work as long as enough recognizable characters of the command are entered.

The following output shows different static-route command syntax and an example of the command usage.

*A:ALA-1>config>router# static-route 
  - [no] static-route {<ip-prefix/prefix-length>|<ip-prefix> <netmask>}
    [preference <preference>] [metric <metric>] [enable|disable] next-hop
    <gateway>
  - [no] static-route {<ip-prefix/prefix-length>|<ip-prefix> <netmask>}
    [preference <preference>] [metric <metric>] [enable|disable] black-hole

2.7.3. Editing keystrokes

When entering a command, special keystrokes allow for editing of the command. The following table describes the command editing keystrokes.

Table 10:  Command editing keystrokes 

Editing action

Keystrokes

Delete current character

<Ctrl-d>

Delete text up to cursor

<Ctrl-u>

Delete text after cursor

<Ctrl-k>

Move to beginning of line

<Ctrl-a>

Move to end of line

<Ctrl-e>

Get prior command from history

<Ctrl-p>

Get next command from history

<Ctrl-n>

Move cursor left

<Ctrl-b>

Move cursor right

<Ctrl-f>

Move back one word

<Esc><b>

Move forward one word

<Esc><f>

Convert rest of word to uppercase

<Esc><c>

Convert rest of word to lowercase

<Esc><l>

Delete remainder of word

<Esc><d>

Delete word up to cursor

<Ctrl-w>

Transpose current and previous character

<Ctrl-t>

Enter command and return to root prompt

<Ctrl-z>

Refresh input line

<Ctrl-l>

2.7.4. Absolute paths

CLI commands can be executed in any context by specifying the full path from the CLI root. To execute an out-of-context command, enter a forward slash “/” or backward slash “\ at the beginning of the command line. The forward slash “/” or backward slash “\” cannot be used with the environment alias command.The commands are interpreted as absolute path. Spaces between the slash and the first command will return an error. Commands that are already global (such as ping, telnet, exit, back, etc.) cannot be executed with a forward slash “/” or backward slash “\ at the beginning of the command line.

*A:ALA-12# configure router 
*A:ALA-12>config>router# interface system address 1.2.3.4 
*A:ALA-12>config>router# /admin save 
*A:ALA-12>config>router# \clear router interface 
*A:ALA-12>config>router# 

The command may or may not change the current context depending on whether or not it is a leaf command. This is the same behavior the CLI performs when CLI commands are entered individually, for example:

*A:ALA-12# admin 
*A:ALA-12>admin# save

or

*A:ALA-12# admin save
*A:ALA-12# 

An absolute path command behaves the same as manually entering a series of command line instructions and parameters.

For example, beginning in an IES context service ID 4 (IES 4),

CLI Syntax:
config>service>ies> /clear card 1

behaves the same as the following series of commands.

CLI Syntax:
config>service>ies>exit all
clear card 1
configure service ies 4 (returns you to your starting point)
config>service>ies

If the command takes you to a different context, the following occurs:

CLI Syntax:
config>service>ies>/configure service ies 5 create

becomes

Example:
config>service>ies>exit all
configure service vpls 5 create
config>service>vpls

2.7.5. History

The CLI maintains a history of the most recently entered commands. The history command displays the most recently entered CLI commands.

*A:ALA-1# history 
   1 environment terminal length 48 
   2 environment no create 
   3 show version 
   4 configure port 1/1/1 
   5 info 
   6 \configure router isis 
   7 \port 1/1/1
   8 con port 1/1/1
   9 \con port 1/1/1
  10 \configure router bgp 
  11 info 
  12 \configure system login-control 
  13 info 
  14 history 
  15 show version 
  16 history 
*A:ALA-1# !3
A:cses-E11#  show version
TiMOS-B-0.0.I2838 both/i386 NOKIA SR 7750 Copyright (c) 2016 Nokia.
All rights reserved. All use subject to applicable license agreements.
Built on Mon Jan 10 18:33:16 PST 2016 by builder in /rel0.0/I2838/panos/main
A:cses-E11#
TiMOS-B-0.0.I232 both/i386 NOKIA SAS-D 7210 Copyright (c) 2016 Nokia.
All rights reserved. All use subject to applicable license agreements.
Built on Sat Oct 11 18:15:40 IST 2016 by panosbld in /panosbld/ws/panos/main
*A:ALU-7210#

2.7.6. Entering numerical ranges

The 7210 SAS CLI allows the use of a single numerical range as an argument in the command line. A range in a CLI command is limited to positive integers and is denoted with two numbers enclosed in square brackets with two periods (“..”) between the numbers:

[x..y]

where x and y are positive integers and y-x is less than 1000.

For example, it is possible to shut down ports 1 through 10 in Slot 1 on MDA 1. A port is denoted with slot/mda/port, where slot is the slot number, mda is the MDA number and, port is the port number. To shut down ports 1 through 10 on Slot 1 and MDA 1, the command is entered as follows:

configure port 1/1/[1..10] shutdown

<Ctrl-C> can be used to abort the execution of a range command.

The following table describes CLI range use limitations.

Table 11:  CLI range use limitations  

Limitation

Description

Only a single range can be specified.

It is not possible to shut down ports 1 through 10 on MDA 1 and MDA 2, as the command would look like

configure port 1/[1..2]/[1..10]

and requires two ranges in the command, [1..2] for the MDA and [1..10] for the port number.

Ranges within quotation marks are interpreted literally.

In the CLI, enclosing a string in quotation marks (“string”) causes the string to be treated literally and as a single parameter. For example, several commands in the CLI allow the configuration of a descriptive string. If the string is more than one word and includes spaces, it must be enclosed in quotation marks. A range that is enclosed in quotes is also treated literally. For example,

configure router interface "A[1..10]" no shutdown

creates a single router interface with the name “A[1..10]”. However, a command such as:

configure router interface A[1..10] no shutdown

creates 10 interfaces with names A1, A2 .. A10.

The range cannot cause a change in contexts.

Commands should be formed in such a way that there is no context change upon command completion. For example,

configure port 1/1/[1..10]

will attempt to change ten different contexts. When a range is specified in the CLI, the commands are executed in a loop. On the first loop execution, the command changes contexts, but the new context is no longer valid for the second iteration of the range loop. A “Bad Command” error is reported and the command aborts.

Command completion may cease to work when entering a range.

After entering a range in a CLI command, command and key completion, which occurs by pressing the <Tab> or spacebar, may cease to work. If the command line entered is correct and unambiguous, the command works correctly; otherwise, an error is returned.

2.7.7. Pipe/match

The 7210 SAS devices support the pipe feature to search one or more files for a specific character string or pattern.

When using the pipe/match command, the variables and attributes must be spelled correctly. The attributes follow the command and must come before the expression/pattern. The following displays examples of the pipe/match command to complete different tasks:

  1. Task: Capture all the lines that include “echo” and redirect the output to a file on the compact flash:
    admin display-config | match “echo” > cf3cf1:\echo_list.txt
  2. Task: Display all the lines that do not include “echo”:
    admin display-config | match invert-match “echo”
  3. Task: Display the first match of “vpls” in the configuration file:
    admin display-config | match max-count 1 “vpls”
  4. Task: Display everything in the configuration after finding the first instance of “interface”:
    admin display-config | match post-lines 999999 interface

Command syntax:

match pattern context {parents | children | all} [ignore-case] [max-count lines-count] [expression]

match pattern [ignore-case] [invert-match] [pre-lines pre-lines] [post-lines lines-count] [max-count lines-count] [expression]

where:

pattern         string or regular expression
context         keyword:  display context associated with the matching line
parents         keyword:  display parent context information
children        keyword:  display child context information
all             keyword:  display both parent and child context information
ignore-case     keyword
max-count       keyword:  display only a specific number of instances of 
                matching lines
lines-count     1 — 2147483647
expression      keyword:  pattern is interpreted as a regular expression
invert-match    keyword
pre-lines       keyword:  display some lines prior to the matching line
pre-lines       0 — 100
post-lines      keyword:  display some lines after the matching line
lines-count     1 — 2147483647

For example:

*A:Dut-G# show log log-id 99 | match ignore-case sap
"Processing of an access port state change event is finished and the status of all a
ffected SAPs on port 1/1/21 has been updated."
"Service Id 4001, SAP Id 1/1/21:0.* configuration modified"
 
 
A:Dut-C# show log log-id 98 | match max-count 1 "service 1001"
"Status of service 1001 (customer 1) changed to administrative state: up, operationa
l state: up"
 
*A:Dut-G# admin display-config | match post-lines 4 max-count 2 expression "vpls"
#--------------------------------------------------
...
        vpls 1 customer 1 svc-sap-type null-star create
            description "Default tls description for service id 1"
            stp
                shutdown
            exit
        vpls 2 customer 1 svc-sap-type null-star create
            description "Default tls description for service id 2"
            stp
                shutdown
            exit
...
#--------------------------------------------------

The following table describes regular expression symbols and interpretation (similar to what is used for route policy regexp matching). The following table describes special characters.

Table 12:  Regular expression symbols  

String

Description

.

Matches any single character.

[ ]

Matches a single character that is contained within the brackets.

[abc] matches “a”, “b”, or “c”. [a-z] matches any lowercase letter.

[A-Z] matches any uppercase letter.

[0-9] matches any number.

[^ ]

Matches a single character that is not contained within the brackets.

[^abc] matches any character other than “a”, “b”, or “c”.

[^a-z] matches any single character that is not a lowercase letter.

^

Matches the start of the line (or any line, when applied in multiline mode).

$

Matches the end of the line (or any line, when applied in multiline mode).

()

Defines a “marked subexpression”.

Every matched instance will be available to the next command as a variable.

*

A single character expression followed by “*” matches zero or more copies of the expression.

{m,n}

Matches at least m and at most n repetitions of the term

{m}

Matches exactly m repetitions of the term

{m,}

Matches m or more repetitions of the term

?

The preceding item is optional and matched at most once.

+

The preceding item is matched one or more times.

-

Used between start and end of a range.

\

An escape character to indicate that the following character is a match criteria and not a grouping delimiter.

>

Redirect output.

Table 13:  Special characters  

Options

Similar to

Description

[:upper:]

[A-Z]

uppercase letters

[:lower:]

[a-z]

lowercase letters

[:alpha:]

[A-Za-z]

upper- and lowercase letters

\w

[A-Za-z_]

word characters

[:alnum:]

[A-Za-z0-9]

digits, upper- and lowercase letters

[:digit:]

[0-9]

digits

\d

[0-9]

digits

[:xdigit:]

[0-9A-Fa-f]

hexadecimal digits

[:punct:]

[.,!?:...]

punctuation

[:blank:]

[ \t]

space and Tab

[:space:]

[ \t\n\r\f\v]

blank characters

\s

[ \t\n\r\f\v]

blank characters

2.7.8. Redirection

The 7210 SAS supports redirection (“>”), which allows the operator to store the output of a CLI command as a local or remote file. Redirection of output can be used to automatically store results of commands in files (both local and remote).

‘ping <customer_ip> > cf3cf1:/ping/result.txt’
‘ping <customer_ip> > ftp://ron@ftp.nokia.com/ping/result.txt’

In some cases only part of the output might be applicable. The pipe/match and redirection commands can be combined:

ping 10.0.0.1 | match expression “time.\d+” > cf3cf1:/ping/time.txt
This records only the RTT portion (including the word “time”).