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?
Shell ScriptingUnix OS
Last Comment
tminelgin
8/22/2022 - Mon
larsrohr
Having your script print a ctrl-G (^G) should make your PuTTY terminal beep.
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".
tminelgin
ASKER
Doesn't seem to work. The UNIX environment here perhaps doesn't support this.
larsrohr
What unix OS is it? (uname -a)
What happens at the unix prompt if you just type ctrl-G and hit return?
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.
scottbisker
Not sure about AIX, but on linux if you pipe random data to the audio device it gives quite an alarm.
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"
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".