zoukankan      html  css  js  c++  java
  • script

    一、简介

    1.应用:
      (1)调试终端会话
      (2)提供Shell教程
    2.命令
      (1)script录制击键和击键时机
      (2)scriptreplay可以回放该会话

    二、技巧

    1.录制终端会话

    [root@localhost 1]# script -t 2> time.log -a action.session
    Script started, file is action.session
    [root@localhost 1]# exit
    exit
    Script done, file is output.session

    说明:

      (1)-t   指明输出录制的时间数据。

          其中时序数据默认发送到stderr,应使用重定向2>到新文件中保存下来

      (2)-a  指明输出录制的方式为追加

      (3)exit 或 Ctrl+d 结束录制

      (4)time.log 和 action.session的名字、后缀可以任意起,通俗易懂即可。

    2.播放终端会话

    [root@localhost 1]# scriptreplay time.log action.session 

    说明:

      (1)-f  如果需要在输出到日志文件的同时,也可以查看日志文件的内容,可以使用 -f 参数。PS:可以用于教学,两个命令行接-f可以实时演示

      (2)-q      可以使script命令以静默模式运行

  • 相关阅读:
    05数组 字符串数组 多维数组
    android textView的渐入效果
    android颜色表
    ExpandableListView置顶和子list收放
    Adb not responding
    android 一个TextView设置多种颜色
    android 循环操作
    Android异步更新
    android 水波纹
    Android 推门效果
  • 原文地址:https://www.cnblogs.com/ytdyz/p/12643648.html
Copyright © 2011-2022 走看看