开发者

A simple way to add pipes to tee-d file

I'm trying to record the output of a command with post processing to clean things up

(like removing ansi escape codes to a file while outputing the command to screen)

(command is minicom which functions as a terminal among other things).

currently I have the following but it doesn't work(seems to block).

rm "${fifo}"
mkfifo "${fifo}"
cat "${fifo}"|filter_1 >"${开发者_如何学Pythonlog_file}" &
command |tee "${fifo}"

p.s.

command | tee "${log_file}"

works fine


Besides unbuffer, you can try

{ command ; printf "\n" ; } | tee "${log_file}"

I hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜