如何在SROS的同一行中运行2个命令?

时间:2019-07-16 12:35:24

标签: command nokia

如何在SROS的同一行中运行2个命令?我尝试过

  1. command1和command2
    1. command1 && command2
    2. command1 | command2
    3. command1 || command2
    4. command1; command2
    5. (command1&)&(command2&)
    6. (command1; command2)&
    7. (command1&)&&(command2&)

1 个答案:

答案 0 :(得分:0)

我不确定是否可行,至少我当前运行的版本无法实现。根据您的要求,您可以将命令加载到配置文件中,然后从CLI作为单个条目执行它。例如,如果您想在一个操作中显示两个VPLS的FDB,则可以将这些show命令添加到CF3上名为 show.cfg 的文件中,然后使用exec cf3:\show.cfg执行。 / p>

A:7705-299# file type cf3:\show.cfg 
File: show.cfg
-------------------------------------------------------------------------------
show service id 7299 fdb detail
show service id 13002297 fdb detail

===============================================================================

A:7705-299# exec cf3:\show.cfg 

===============================================================================
Forwarding Database, Service 7299
===============================================================================
ServId    MAC               Source-Identifier        Type     Last Change
                                                     Age      
-------------------------------------------------------------------------------
7299      01:0b:20:0b:ca:d7 sap:1/1/10               L/44     03/29/20 11:23:34
7299      30:c8:98:c6:b5:47 sdp:11:7299              L/456    01/16/20 15:02:17
-------------------------------------------------------------------------------
No. of MAC Entries: 2
-------------------------------------------------------------------------------
Legend:  L=Learned O=Oam P=Protected-MAC C=Conditional S=Static
===============================================================================

===============================================================================
Forwarding Database, Service 13002297
===============================================================================
ServId    MAC               Source-Identifier        Type     Last Change
                                                     Age      
-------------------------------------------------------------------------------
13002297  0a:b0:02:cf:5a:f0 sap:1/1/7:200            L/117    04/09/20 11:11:20
13002297  11:a2:a8:c6:b5:47 sdp:11:13002297          L/396    02/13/20 11:13:11
13002297  3d:d0:4b:25:5c:fc sap:1/1/12               L/44     04/21/20 00:59:03
-------------------------------------------------------------------------------
No. of MAC Entries: 3
-------------------------------------------------------------------------------
Legend:  L=Learned O=Oam P=Protected-MAC C=Conditional S=Static
===============================================================================
Executed 2 lines in 0.8 seconds from file cf3:\show.cfg