【问题标题】:script to record terminal on Mac在 Mac 上录制终端的脚本
【发布时间】:2017-06-12 09:33:54
【问题描述】:

script 是记录终端中所有活动的好工具(http://linuxers.org/article/script-command-line-tool-recordsave-your-terminal-activity)。 Mac 上的内置 script 可执行文件无法记录打字稿的时间。我正在尝试编译 util-linux 包(https://github.com/karelzak/util-linux,其中包含 linux 版本script)但没有成功:

$ make
make  all-recursive
Making all in po
make[2]: Nothing to be done for `all'.
  CC       lib/libcommon_la-strutils.lo
In file included from lib/strutils.c:16:
./include/strutils.h:77: error: conflicting types for 'strmode'
/usr/include/string.h:168: error: previous declaration of 'strmode' was here
lib/strutils.c:351: error: conflicting types for 'strmode'
/usr/include/string.h:168: error: previous declaration of 'strmode' was here
lib/strutils.c: In function 'size_to_human_string':
lib/strutils.c:442: warning: format '%jd' expects type 'intmax_t', but argument 8 has type 'uint64_t'
make[2]: *** [lib/libcommon_la-strutils.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

有没有为 Mac 编译的可执行文件?

【问题讨论】:

    标签: macos terminal


    【解决方案1】:

    ttyrec 包含对计时问题的修复,并且出于所有意图和目的,提供相同的功能(在其手册页中描述为 script 的派生词)。它可以通过 brew (brew install ttyrec) 或 MacPorts (sudo port install ttyrec) 获得。

    • ttyrec:官网
    • shelr.tv:YouTube 用于终端录音
    • ttygif:将终端录音转换为 GIF 动画

    【讨论】:

    • OSX High Sierra: Error: Port ttyrec not found 和 brew 版本失败 Out of pty's :(
    【解决方案2】:

    OS X 上的scriptversion 具有-r 选项,它将所有输入、输出和计时记录在一个文件中。可以使用-p 选项重播。

    【讨论】:

      【解决方案3】:

      以防万一其他人在这里偶然发现如何在 MacOS 上重放使用 script 的 util-linux 版本录制的脚本,您可能会发现这很有用:

      https://bitbucket.org/rewbs/docker-scriptreplay

      它只是一个非常简单的基于 Alpine Linux 的 Docker 映像,使您能够在 MacOS 上运行scriptreplay(通过 Docker)。我发现这对于确保广大 Mac 用户可以使用标准工具重播 Linux 服务器上记录的脚本很有用。希望其他人觉得这很有用! :)

      【讨论】:

        【解决方案4】:

        我正在尝试编译 util-linux 包(https://github.com/karelzak/util-linux,其中包含 linux 版本脚本)但没有成功:

        编译器关于“不兼容类型”的错误消息是它失败的线索。驻留在 OS X(基于 BSD)上的系统头文件中的声明与来自 util-linux(基于 GNU/Linux)的包含文件中的声明之间存在冲突。

        【讨论】:

          猜你喜欢
          • 2018-01-08
          • 2010-10-18
          • 2020-04-01
          • 1970-01-01
          • 2016-02-17
          • 2011-08-17
          • 2012-04-18
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多