boulder_ruby boulder_ruby - 1 year ago 110
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 Source

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`
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download