VI Editor
Page 48 7750 SR OS Basic System Configuration Guide
Pipe/Match
The 7750 SR OS 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” > cf3:\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”
Command syntax:
match [ignore-case] [invert-match] [post-lines num-lines] [max-count
num-matches] [expression] pattern
where:
ignore-case keyword
invert-match keyword
num-lines 1 — 2147483647
num-matches 1 — 2147483647
expression keyword
pattern string or regular expression
For example:
A:Dut-C# show log log-id 98 | match ignore-case "sdp bind"
"Status of SDP Bind 101:1002 in service 1001 (customer 1) changed to admin=up oper=up
flags="
"Processing of a SDP state change event is finished and the status of all affected SDP
Bindings on SDP 101 has been updated."
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, operational
state: up"