write to a file after piping output from tail -f through to grep

前端 未结 4 654
孤独总比滥情好
孤独总比滥情好 2021-01-05 15:19

I\'m looking to write to a file after piping output from tail -f through to grep. Say,write to a file \"temp\" for all lines with \"Playing:\" within in error_log \"FreeSwit

4条回答
  •  梦谈多话
    2021-01-05 16:00

    Maybe you have an issue with buffering? See BashFAQ: What is buffering?

    You could e.g. try:

    tail -f /var/lof/freeswitch/freeswitch.log | grep --line-buffered "Playing:" > temp
    

提交回复
热议问题