Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Audible alarm from Unix shell script

Posted on 2010-11-14
9
Medium Priority
?
1,203 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:tminelgin
ID: 34145933
AIX and 'ctrl-G' not found
0
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…
Suggested Courses
Course of the Month11 days, 8 hours left to enroll

916 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