Last active
July 2, 2021 08:37
-
-
Save FriendlyTester/f76722aeee286cfaeade to your computer and use it in GitHub Desktop.
Shell Script To Play Sounds On Word Match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tail -n 0 -f log.txt | grep --line-buffered 'ERROR' | while read line; do afplay beep-01a.wav; done | |
#log.txt this is the log file you want to tail. Full path if not in that directory | |
#'ERROR' is the stirng you are looking to match | |
#beep-01a.wav is the sound to play when string matched. Full path if not in that directory | |
#Maik later responded saying his logfile was on a remote server, he discovered the following worked to tail a remote file | |
ssh <user@remoteserver> tail -n 0 -f log.txt | grep --line-buffered 'ERROR' | while read line; do afplay beep-01a.wav; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment