LinuxBasics.org

The community that helps people to run Linux

rss
Table of Contents

Turn Off Beep and BASH Login Configuration

How to turn off the Beep

Since the beep you want to silence is shell-specific, I would set in in .bashrc for both console and xterm with something like:

case $TERM in      
    xterm)
        xset b off
        ;;
    *)
        setterm -blength 0
        ;;
esac

Explanation of where BASH looks

When launched as a login shell, bash reads:
1a) /etc/profile
1b) ~/.bash_profile
1c) ~/.bash_login (if ~/.bash_profile doesn’t exist)
1d) ~/.profile (if ~/.bash_profile and ~/.bash_login don’t exist)

When launched as a non-login interactive shell (by typing “bash”), bash reads:
2) ~.bashrc

When launched as a non-login non-interactive shell (in scripts), bash reads:
3a) $BASH_ENV 3b) $ENV (if $BASH_ENV doesn’t exist)

To ensure that all three types of bash shells are launched with the same environment you need to make sure that: - $BASH_ENV exists and is set to the primary configuration file - that ~/.bashrc is the primary configuration file (since it is the only one that non-login interactive shells read) - that at least one of the login shell’s configuration file exists and points to ~/.bashrc

Pick ~/.bash_profile (otherwise ~/.bash_login or ~/.profile may never get read) and make sure it contains the following two lines:

   export ENV=~/.bashrc i
   [ -f ~/.bashrc ] && . ~/.bashrc

Now, no matter how it is invoked bash always sources .bashrc and you always have the same environment.

XFree86 documentation specifies that programs reference settings in:

$XINITRC (by default = .xinitrc)
.Xinit
.xinit
.Xinitrc
.xinitrc
.xsession
in that order.

Either the Xorg developers simplified things, or else people just stopped using most of them, and the only ones mentioned for Xorg are:
$XINITRC
.xinitrc

— Contributed by Jason Armstrong: http://linuxbasics.org/pipermail/qna/2005-October/002175.html


Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.


Linux® is a registered trademark of Linus Torvalds.


 
  tutorials/using/beep_and_bash_login.txt · Last modified: 2008/07/20 21:08

LinuxBasics.org

Start Linux-Course Tutorials Linux Links Security Blog Forum E-mail List Search Online Chat

Site-Info

Help Get in Touch Making of LBo

Wiki-Control

Powered by

Linux Apache DokuWiki Mailman RUTE ht://Dig