gpt4 book ai didi

linux - 在 Mac OS X 上运行 "yes 0 | script -c ' ispell text.txt'/dev/null"

转载 作者:太空宇宙 更新时间:2023-11-04 05:50:30 24 4
gpt4 key购买 nike

我快疯了,在我的 Linux 机器上我会运行:

yes 0 | script -c 'ispell text.txt' /dev/null

With any problem. Unfortunately on Mac OS X the command script is not accepting the '-c' option:

script: illegal option -- c

我安装了brew:binutils、coreutils和其他软件包..但是在任何地方都没有scriptscript替代命令。

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不支持-c标志,那么您可以将该命令添加为标准输入:

echo 'ispell text.txt' | script /dev/null

但是看看该命令,您似乎使用了错误的命令,因为输出文件是 /dev/null

改为使用:

bash -c 'ispell text.txt'

或者甚至:

ispell text.txt

关于linux - 在 Mac OS X 上运行 "yes 0 | script -c ' ispell text.txt'/dev/null",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40341499/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com