Solved

Audible alarm from Unix shell script

Posted on 2010-11-14
9
1,175 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
ID: 34133738
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
ID: 34141626
Doesn't seem to work.  The UNIX environment here perhaps doesn't support this.
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34142458
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
ID: 34145933
AIX and 'ctrl-G' not found
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 12

Expert Comment

by:larsrohr
ID: 34146446
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
ID: 34175792
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
ID: 34184422
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
ID: 34184591
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
ID: 34216194
tired of asking
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
shell script to send sms 2 88
Issue with cURL on Windows 7 82
UNIX SCP 5 65
Determine Who is Runnig my Bash Shell Script 4 62
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

910 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

22 Experts available now in Live!

Get 1:1 Help Now