[20140922]scriptreplay的使用.txt
--今天在使用命令不全的时候发现系统存在一个scriptreplay的命令,从命令名字上看是执行命令的回显.
--查看man scriptreplay文档,发现里面有一个例子,简单的测试看看.
--注意:我使用的是centos 6.2,好像centos4.X的版本还没有这个命令.
EXAMPLE
% script -t 2> timingfile
Script started, file is typescript
% ls
% exit
Script done, file is typescript
% scriptreplay timingfile
--注意这样执行的内容放在typescript里面.自己做简单的测试:
$script -t 2> timingfile
...
执行一些命令,然后是退出.
...
$ scriptreplay timingfile
--这样就可以回显执行的过程,很有意思.
--进一步提高,可以指定记录文件使用-a选项.
$ script -t 2> timingfile.log -a output.session
Script started, file is output.session
...
执行一些命令,然后是退出.
...
$ scriptreplay timingfile.log output.session 2
--If the third parameter is specified, it is used as a speed-up multiplier. For example, a speed-up of 2 makes
--scriptreplay go twice as fast and a speed-up of 0.1 makes it go ten times slower than the original session.
--后面的参数可以起到一定的加速作用.设置小于1可以实现减速的功能.
--这样可以满足一些公司做一些重要操作时,保留操作步骤的需要.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-1276764/ ,如需转载,请注明出处,否则将追究法律责任。