Bell on new line

To have a Linux beep each time a new line is printed on standard output, just filter your output through the following code:

gawk '{print "\007" $0 }'

This will effectively “prepend” a bell to each line.

You can convert this into an alias or a command (say /usr/local/bin/line-beep.gawk):

#!/usr/bin/gawk -f

{ print "\007" $0; }

So it can be used in a code like the following:

tail -f /var/log/messages | grep --line-buffered dhcpd | line-beep.bash

Leave a Reply

Please leave these two fields as-is: