tminelgin
asked on
Audible alarm from Unix shell script
I am running a Putty session on windows XP and I would like my shell script to give me an audible alarm.
ex
run program that produces text line like job_name job_start Job_status etc.
grep ' FA ' from line and beep.
Is this possible?
ex
run program that produces text line like job_name job_start Job_status etc.
grep ' FA ' from line and beep.
Is this possible?
ASKER
Doesn't seem to work. The UNIX environment here perhaps doesn't support this.
What unix OS is it? (uname -a)
What happens at the unix prompt if you just type ctrl-G and hit return?
What happens at the unix prompt if you just type ctrl-G and hit return?
ASKER
AIX and 'ctrl-G' not found
Are you typing "ctrl-G" or are you using the Ctrl key and the G key simultaneously? The latter is what you want -- just hitting the Ctrl and G keys simultaneously.
As a control character, ctrl-G (or ^G) should make a noise, but not show up as an entered command.
As a control character, ctrl-G (or ^G) should make a noise, but not show up as an entered command.
Not sure about AIX, but on linux if you pipe random data to the audio device it gives quite an alarm.
echo "asldfjal;sdfja;lsdfjl;ask dfj;alkfdj l;akfdj" > /dev/audio
echo "asldfjal;sdfja;lsdfjl;ask
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
echo "\a"
or
echo \\a
Works in my Putty session from Windows Vista to AIX with "Terminal" -> "Bell" -> "Make default system alert sound" and "Terminal" -> "Bell" -> "Beep using the PC speaker"
wmp
or
echo \\a
Works in my Putty session from Windows Vista to AIX with "Terminal" -> "Bell" -> "Make default system alert sound" and "Terminal" -> "Bell" -> "Beep using the PC speaker"
wmp
ASKER
tired of asking
You can adjust your PuTTY settings (category Terminal -> Bell) to change how the beep works for you. I found the "default system alert sound" to be rather quiet; "Beep using the PC speaker" was a little more noticeable, but you could also set a custom sound.
To have your script do "echo ^G", you may need to type "echo <ctrl>-V<ctrl>-G".