I'm making a small ruby command line script and I wanted to know what the simplest way to have the program emit a beep is.
beep allows the user to control the pc-speaker with precision, allowing different sounds to indicate different events. While it can be run quite happily on the command line, it's intended place of residence is within shell/perl scripts, notifying the user when something interesting occurs.
Try printing the audible bell character:
print "\a"
For Mac OS X:
system('say "beep"')
Conventional print "\a"
didn't always work by some reason for me (MBA, 10.7.4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With