I am currently facing a problem with the command
while sleep 0.3; do echo "1"; done | tail -n +3 | grep --line-buffered "1"
I wanted an output that looks like:
[nothing during 0.6s]
1
1
...
but had:
[nothing forever]
I found this question and read this blog post but as the --line-buffered
option is set for grep
, I think this is not a buffering problem. My researches did not led me to other solutions, I hope I did not miss something obvious.
I am using zsh 5.7.1 (x86_64-pc-linux-gnu)
if it is important.