OGG常用命令(一)–!

1、!

使用该!命令无需更改即可执行先前的GGSCI或Admin Client命令。要在再次执行命令之前修改命令,请使用FC命令。要显示以前的命令列表,请使用该 HISTORY命令。!不带参数的命令将执行最新命令。使用选项,您可以通过指定行号或文本子字符串来执行任何先前的命令。以前的命令只有在当前会话期间发出时才能再次执行,因为在每个会话之间都不会保留命令历史记录。

语法:! [n | -n | string]

n
从指定的行执行命令。每个命令行都有顺序,在会话开始时以1开头。

-n
执行当前行前n行发出的命令。

string
执行以指定文本字符串开头的最后一个命令。

举例1:

GGSCI (localhost.localdomain) 11> history

GGSCI Command History

    2: start rp_49
    3: info rp_49
    4: info rp_49
    5: history
    6: history
    7: status rp_49
    8: start rp_49
    9: start rp_49
   10: start rp_49
   11: history

GGSCI (localhost.localdomain) 12> !
history

GGSCI Command History

    3: info rp_49
    4: info rp_49
    5: history
    6: history
    7: status rp_49
    8: start rp_49
    9: start rp_49
   10: start rp_49
   11: history
   12: history

举例2:

GGSCI (localhost.localdomain) 12> !
history

GGSCI Command History

    3: info rp_49
    4: info rp_49
    5: history
    6: history
    7: status rp_49
    8: start rp_49
    9: start rp_49
   10: start rp_49
   11: history
   12: history

GGSCI (localhost.localdomain) 13> !7
status rp_49
REPLICAT RP_49: RUNNING

举例3:

GGSCI (localhost.localdomain) 14> history             

GGSCI Command History

    5: history
    6: history
    7: status rp_49
    8: start rp_49
    9: start rp_49
   10: start rp_49
   11: history
   12: history
   13: status rp_49
   14: history

GGSCI (localhost.localdomain) 15> !-2
status rp_49
REPLICAT RP_49: RUNNING

举例4:

GGSCI (localhost.localdomain) 16> history

GGSCI Command History

    7: status rp_49
    8: start rp_49
    9: start rp_49
   10: start rp_49
   11: history
   12: history
   13: status rp_49
   14: history
   15: status rp_49
   16: history

GGSCI (localhost.localdomain) 17> !sta
status rp_49
REPLICAT RP_49: RUNNING

Related Posts