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.
精彩评论