I need to analyze a log for specific output and if a certain keyword is matched in the output, I need to issue an echo -e "\a".
How would I filter a script so that this would occur? I pass it through ack[-grep] as well so I’d like to put the alarm notification in prior to the colorization probably.
This spawns more processes than sed, but puts the control character on the terminal via stderr so that it is less likely to be modified by downstream processes. Also, it is entirely possible for an implementation of sed to buffer its input and not generate any output until tail generates 8K or so of output, so you might get the alert hours or days after the data occurs.