how to play beep sound inside shell script?
Hi All,
I need to make beep sound inside my basic shell script. ex: #!/bin/sh if ping 172.16.XXX.XXX then echo " Server is running " else #--- make system sound-------- echo " Server idle " fi note: how to check my linux system is working with these system sounds ? ex : $] beep there were no any sound play through speaker but system --> preferences--> sound all testing stages are successful. Regards, HK |
aplay is your friend
An alternative is to use "aplay soundfile.wav".
In a shell script, you can use the command echo -e "\a" or the command mentionned just before. |
This script seems to work (run as root)
Code:
#!/bin/bash ciao, jdk |
|
beep only works if your PC has a "speaker". Many modern laptops / small devices don't have one.
|
Thanks All for ur suggestions,
Actually i used .wav file to make sound just putting if <condition> then play xxxxx.wav fi i thought why i'm think much about beep sound , i design a my solution using sound file Best Regards , HK |
All times are GMT -5. The time now is 02:47 AM. |