EM316LNXNM-OT
Foreach
PN 1275005-100 Rev E6
75
Chapter 8. Foreach
...apply a command sequentially to a list of target components
The "
foreach
" command applies a command sequentially to each component in a specified set of
components. If a specified target component does not support the desired command, an error message is
generated and the command is applied to the next specified component. Each specified target component
that does not support the desired command generates an error message, and the system applies the
command to the next specified component. Ports on the network manager module also generate errors.
The component set is designated by individual components or ranges for chassis, slot, and port. The "*"
wildcard character may be used to match any existing component ordinal within the command "
LOC
"
syntax. The command syntax is described in more detail below.
The "
foreach
" command is available in the configuration context, as show below in the interactive CLI
help display:
fiberdriver# configure terminal
fiberdriver(config)# foreach?
foreach - Execute a command on a set of objects
fiberdriver(config)# foreach ?
LOC - Range of locations, Ex. 1.2-4,9.* or 1.*.3,4, etc.
fiberdriver(config)#
The box below shows an example of the
foreach
command:
fiberdriver(config)# foreach 1.*.* shutdown
Executing 'shutdown' for '1.1.1'
Executing 'shutdown' for '1.1.2'
Executing 'shutdown' for '1.2.1'
Executing 'shutdown' for '1.2.2'
Executing 'shutdown' for '1.3.1'
Executing 'shutdown' for '1.3.2'
Executing 'shutdown' for '1.4.1'
Executing 'shutdown' for '1.4.2'
Executing 'shutdown' for '1.5.1'
Executing 'shutdown' for '1.5.2'
Executing 'shutdown' for '1.6.1'
Executing 'shutdown' for '1.6.2'
Executing 'shutdown' for '1.7.1'
Executing 'shutdown' for '1.7.2'
Executing 'shutdown' for '1.8.1'
Executing 'shutdown' for '1.8.2'
Ignoring NM port '1.9.1'
Ignoring NM port '1.9.2'
fiberdriver(config)#
Notice that the latest version of the
foreach
command ignores ports on the network manager.
Содержание EM316LNXNM-OT
Страница 174: ...EM316LNXNM OT Appendix PN 1275005 100 Rev E6 167 Access Read only CLI command volt monitor 4...
Страница 181: ......