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 "07" $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 "07" $0; }

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

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

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *