Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Command Line Beeping

Posted on 2003-11-30
16
Medium Priority
?
6,801 Views
Last Modified: 2007-12-19
Hey everyone -

I assume this is probably a pretty easy question to answer, as it is probably just setting a 1 to 0 in some file, but I can't find where.  My command line will let out this annyoing 'BEEP' everytime I do something wrong.  (Like try and continue to scroll after I have reached the bottom of a file in vi, or hitting TAB when there is more than one file to list, etc...)

Anyway, as this is a laptop, it is extremely annoying to have happen when I am somewhere like a restauraunt.  Is there a way to turn this beeping off?

~ace
0
Comment
Question by:Topace
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +3
16 Comments
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9847386
will there any sound/volume control on your laptop? normal on the side of your laptop try to use the control to turn your laptop sound off or to the lowest.
0
 
LVL 1

Author Comment

by:Topace
ID: 9847443
no all the sound control is in the os

~ace
0
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9848359
have a check here http://www.linuxgazette.com/issue47/ayers.html#ayers2 but it only for play music on command line, and you need to install software into your OS.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Accepted Solution

by:
Gns earned 200 total points
ID: 9848913
As I understand this, you want to avoid an audible... This is a "properety" of your shell (the actual ringing of the terminal bell).
Assuming you are using bash, it isn't actually the shell that keep ringing your bell... rather it is the readline library (incorporated for things like eiting command history etc)... Perhaps the following snippet from the bash man-page would help:
----------------------------
       bell-style (audible)
              Controls  what  happens when readline wants to ring
              the terminal bell.  If set to none, readline  never
              rings the bell.  If set to visible, readline uses a
              visible bell if one is available.  If set to  aud­
              ble, readline attempts to ring the terminal's bell.
----------------------------
So add the following (or chage it if already there:-):
set bell-style none
in your $HOME/.inputrc, and those pesky beeps should go away;-).

-- Glenn
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 9858996
Gns, the above will only work if he is in a virtual console. If he is running from a terminal in X he needs to put the line "xset b off" in one of his X startup files such as .xinitrc or .xsession.
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 9858997
Gns, the above will only work if he is in a virtual console. If he is running from a terminal in X he needs to put the line "xset b off" in one of his X startup files such as .xinitrc or .xsession.
0
 
LVL 20

Expert Comment

by:Gns
ID: 9859551
No. The xset setting will take precedence under X, but the readline setting will prevent bash (and anything else using readline) from even trying to ring the bell. So one might say its the other way around:-)... "xset b off" will only work for X, while "set bell-style none" will work anywhere:-):-).
Best solution would probably be a combination;).

-- Glenn
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 9859641
I set "bell style none" but couldnt get the bloody thing to stop beeping under X until the "xset b off". Its a mystery :)
0
 
LVL 20

Expert Comment

by:Gns
ID: 9859737
Yes... I do believe I've got this working... checking... Oh, I see a possibility... Did you remember to restart the shell (logout/login)? Just checked on a Mdk9.2, and both the .inputrc and xset things work as expected (ie: as I/the docs say:-).

-- Glenn
0
 
LVL 20

Expert Comment

by:Gns
ID: 9859938
... and you (for the xset thing... not trying to usurp anything here:-).

-- Glenn
0
 
LVL 5

Expert Comment

by:paulqna
ID: 9860286
All you need is the escape sequences:

Per-console Beep Configuration

  As of Linux 1.3.43, Martin Mares added configurability to the bell
  sound in console.c. You can change the duration and pitch of the
  console beep on a per-console basis, by writing escape sequences to
  the tty. You can apply your configuration in your own ~/.profile or
  ~/.login, to have a different beep (or no beep) associated to each
  console.

  The escape sequences work as follow:

  ·  ESC-[10;xx] chooses the bell frequency in Hertz. The value should
     be in the range 21-32766, otherwise the result is undefined (at
     least up to the 2.0.x version -- I can't foresee the future.  If
     the `xx' argument is missing, the default value (750Hz) will apply,
     as in `ESC-[10].

  ·  ESC-[11;xx] chooses the bell duration, in milli-seconds.  If you
     specify more than 2 seconds, the default applies (125ms). Once
     again, if the `xx' argument is missing (ESC-[11]) the default value
     will be used.

  To print the escape sequences, you can try for example (50Hz, 1s)
  "echo -e "\33[10;50]\33[11;1000]"" with bash (where "-e" means
  `understand escape sequences'. With tcsh "echo
  " 33[10;50] 33[11;1000]" will have the same effect.

  Note that a new `setterm' command might support bell configuration of
  command line, as these control codes are marked as `setterm-commands'.
  However, no `setterm' version I know of supports these codes.

  If you run Linux-1.3.43 or newer, you may be satisfied with the escape
  sequences and avoid reading further. If you run an older kernel (I do
  it myself, on a small 386), or if you want the visual bell, have a
  good reading.
0
 
LVL 5

Expert Comment

by:paulqna
ID: 9860296
whoops forget that, misunderstood question completely...
0
 
LVL 20

Expert Comment

by:Gns
ID: 9864959
;-)

-- Glenn
0
 
LVL 1

Expert Comment

by:ajenkins
ID: 9883032
echo 0 >/proc/sys/dev/speaker/beep
0
 
LVL 20

Expert Comment

by:Gns
ID: 10182280
Clearly answered (no refund)... Possibly a split.

-- Glenn
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

636 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