• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1213
  • Last Modified:

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?
0
tminelgin
Asked:
tminelgin
1 Solution
 
larsrohrCommented:
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".

0
 
tminelginAuthor Commented:
Doesn't seem to work.  The UNIX environment here perhaps doesn't support this.
0
 
larsrohrCommented:
What unix OS is it?  (uname -a)

What happens at the unix prompt if you just type ctrl-G and hit return?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
tminelginAuthor Commented:
AIX and 'ctrl-G' not found
0
 
larsrohrCommented:
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.
0
 
scottbiskerCommented:
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;askdfj;alkfdjl;akfdj" > /dev/audio
0
 
tminelginAuthor Commented:
nope, giving up.  Not that important.  BTW hitting cntl G places ^G on the line and when entered throws
"sh ^G not found"
0
 
woolmilkporcCommented:
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
0
 
tminelginAuthor Commented:
tired of asking
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now