【发布时间】:2011-08-30 07:35:33
【问题描述】:
我正在尝试使用后处理来记录命令的输出以进行清理
(例如在将命令输出到屏幕时将 ansi 转义码删除到文件中)
(命令是 minicom,除了其他功能外,它还充当终端)。
目前我有以下但它不起作用(似乎阻塞)。
rm "${fifo}"
mkfifo "${fifo}"
cat "${fifo}"|filter_1 >"${log_file}" &
command |tee "${fifo}"
附言
command | tee "${log_file}"
工作正常
【问题讨论】:
-
查看您的系统是否有可用的
unbuffer命令。您可能需要尝试查看哪些生成命令必须是unbuffered。祝你好运。
标签: shell named-pipes tee