Solved

Audible alarm from Unix shell script

Posted on 2010-11-14
9
1,171 Views
Last Modified: 2012-05-10
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
Comment
Question by:tminelgin
9 Comments
 
LVL 12

Expert Comment

by:larsrohr
Comment Utility
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
 

Author Comment

by:tminelgin
Comment Utility
Doesn't seem to work.  The UNIX environment here perhaps doesn't support this.
0
 
LVL 12

Expert Comment

by:larsrohr
Comment Utility
What unix OS is it?  (uname -a)

What happens at the unix prompt if you just type ctrl-G and hit return?
0
 

Author Comment

by:tminelgin
Comment Utility
AIX and 'ctrl-G' not found
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 12

Expert Comment

by:larsrohr
Comment Utility
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
 
LVL 3

Expert Comment

by:scottbisker
Comment Utility
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
 

Accepted Solution

by:
tminelgin earned 0 total points
Comment Utility
nope, giving up.  Not that important.  BTW hitting cntl G places ^G on the line and when entered throws
"sh ^G not found"
0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
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
 

Author Closing Comment

by:tminelgin
Comment Utility
tired of asking
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now