EM316LNXNM-OT
Foreach
PN 1275005-100 Rev E6
76
The syntax of the
foreach
command is:
fiberdriver(config)# foreach LOC command string
...where
C
,
S
, and
P
are one of the following:
• "
N
" - single number, matches one number only.
"Single Number" is the easiest implementation of the "
foreach
" command. For example, "
foreach
1.2.3 command string
" executes "
command string
" on port 3 of slot 2 in chassis 1.
• "
*
" - wildcard, matches anything.
The wildcard character (*) repeats the "
foreach
" command on all sub-components. For example,
"
foreach 1.2.* command string
" executes "
command string
" on all ports of slot 2 in
chassis 1. "
foreach 1.*.* command string
" executes "
command string
" on all ports of
all slots in chassis 1.
• "
S-E
" - range that matches from
S
to
E
inclusive.
The range syntax allows for the inclusion of a continuous span of components. For example, "
foreach
1.2.1-5 command string
" executes "
command string
" on ports 1, 2, 3, 4, and 5 of slot 2
in chassis 1.
• "
,
- combine ranges or numbers:
S-E,N,N
Include non-sequential components in the "
foreach
" command by specifiying multiple comma-
separated ranges. For example, "
foreach 1.2.1-5,10-15 command string
" executes
"
command string
" on ports 1, 2, 3, 4, 5, 10, 11, 12, 13, 14, and 15 of slot 2 in chassis 1.
...and the command string for iteration follows the range of components.
The command string appears as if typed in the context of a specific component. Context sensitive command
line completion (<Tab> or question mark help) is not available in the
foreach
command string. An error
message displays for each designated component that does not exist or if the command does not apply
to that component.