【发布时间】:2017-03-13 11:54:13
【问题描述】:
我快疯了,我会在我的 Linux 机器上运行:
是 0 | script -c 'ispell text.txt' /dev/null
有任何问题。不幸的是,在 Mac OS X 上,script 命令不接受“-c”选项:
script: illegal option -- c
我安装了 brew: binutils、coreutils 和其他软件包.. 但没有任何地方 script 或 script 替代命令。
在google上查到linux下的包是util-linux:https://www.kernel.org/pub/linux/utils/util-linux/
但是对于 mac OS X 或在编译包或 brew 源中都找不到它。
谁能指点我正确的方向?
PS:我的最终目标是实现这一点:Spell checking a file using command line, non-interactively
【问题讨论】:
-
什么是
script? bash 确实支持-c,任何 POSIX 兼容的 shell 也是如此。 -
不幸的是,与 Mac OS X Sierra 捆绑在一起的 bash 不支持“-c”,brew 中的也不支持....
-
阅读 OSX bashsays 的手册页:developer.apple.com/legacy/library/documentation/Darwin/…
-
命令是'script',它不是'bash'的选项:developer.apple.com/legacy/library/documentation/Darwin/…(这是在达尔文)-man7.org/linux/man-pages/man1/script.1.html这是在Linux...
-
所以它与 bash 无关,但评估名为
script的命令。安装较新版本的 bash 不会使另一个命令支持更多标志。
标签: linux macos scripting command-line-interface ispell