boulder_ruby boulder_ruby - 5 months ago 16
Bash Question

How do I get shell/ruby to make a noise (make my computer beep or play a sound/track) when my script breaks?

I'm running a testing script that runs over a website over and over again that runs hundreds of times over the course of several hours. I would like for ruby to starting playing a loud song/mp3 for example, to alert me while I'm in a different part of my fairly small apartment.

Answer

Also on mac there is the afplay program, so it would be possible to do something like:

sleep 180 # sleep 3 minutes
`afplay my_song.mp3`