CLI Usage
7210 SAS D, E, K OS Basic System Configuration Guide Page 41
Pipe/Match
The 7210 SAS devices supports the pipe feature to search one or more files for a given character
string or pattern.
Note: When using the pipe/match command the variables and attributes must be spelled correctly.
The attributes following the command and must come before the expression/pattern. The
following displays examples of the pipe/match command to complete different tasks:
• 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
• Task: Display all the lines that do not include “echo”:
admin display-config | match invert-match “echo”
• Task: Display the first match of “vpls” in the configuration file:
admin display-config | match max-count 1 “vpls”
• 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