I needed to count the open and close events in an active log file. Since I needed to start the count at zero I needed to start counting at the first line of the log and continue as the log grew. I needed both
cat and
tail -f. Turns out that
tail can do both using
tail -c +0 -f events.log. And so all I needed to do was to pipe the output to the counting script. The script took several minutes to catch up from processing previous events to current events but the counts it displays are accurate.