美文网首页
Script Record and Replay

Script Record and Replay

作者: lucientlau | 来源:发表于2017-09-18 20:44 被阅读0次

    script and scriptreplay

    The following command start script record

    $ script -t 2> timing.log -a output.session
    

    Then type the command u want to record like

    $ ls
    ...
    ...
    ...
    $ exit
    

    Input exit command to stop record.
    Type the command below to replay the script.

    $ scriptreplay timing.log output.session
    

    Real Time Command Display

    • First open two terminal
    • In terminal-1
      • Input the follow command
      • The upon command will create a file named scriptfifo in current fold
    $ mkfifo scriptfifo   # make a pipe
    
    • In terminal-2
    $  cat scriptfifo
    
    • In terminal-1
    $ script -f scriptfifo
    
    • Then when u input command in terminal-1 the terminal-2 will redo the same command automatic.

    After the test use unlink scriptfifo to close the pipe.

    相关文章

      网友评论

          本文标题:Script Record and Replay

          本文链接:https://www.haomeiwen.com/subject/rhxisxtx.html