I just found a weird bug in the way tail and grep work together. I've tested this on Slackware -current and Fedora Core 2. Run this code in your terminal:
Code:
$ echo bob jones > bob
$ tail -n 1 | grep bob | grep bob
bob jones
$ tail -fn 1 | grep bob
bob jones
<CTRL+C>
$ tail -fn 1 | grep bob | grep bob
<CTRL+C>
The last command outputs
NOTHING!. This should output "bob jones" like the others, what is going on?
I just noticed this while tailing my syslog file, watching iptables' output.
I know this used to work, so when did this all of a sudden happen?
This only happens with the "-f" option, and two piped greps to it. (Note: the -n 1 isn't really needed)