Your .bashrc file is where you can place any shell commands that
you want executed every time you start up a new shell.
Here is the TCC standard .bashrc file with interspersed
commentary.
#File: /usr/local/adm/lib/initial_dir_src/.bashrc
## If not a login shell, source /etc/profile anyway
if [ "$0" != "-bash" ] ; then
. /etc/profile
fi
The above lines cause the .profile file to be read even if the
current shell ($0) is not bash. That file sets up your default
search path.
## to add someting to your path, do something like the
following
export PATH=${PATH}:${HOME}/bin
There's a lot going on in the above line. The export command sets a
variable in this script but also ``exports'' it so it affects
things outside this script. The ${PATH} part is a special function
that expands to your current search path. The ${HOME} function
expands to your home directory's pathname, so effectively it adds
your ~/bin directory to your search path. The colon (
must be used to separate elements of the search
path.
## set a happy editor for programs that want them
export EDITOR='pico'
export VISUAL='pico'
This sets up two environmental variables, EDITOR and VISUAL, that
some programs expect to find to tell them what editor you like.
Substitute emacs or vi for pico in the above lines if you prefer
one of those editors.
set history=40
Tells bash to remember the last 40 commands you have typed. Refer
to ``history substitution'' in the textbook to see how you can
recall such previously entered commands and execute them
again.
## some usefull aliases, so new users don't hurt themselves
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ls='ls -F'
The bash alias command sets up new commands as shorthand for longer
commands. For example, the first command makes rm an alias for the
rm command with the -i option so that the shell will ask the user
before removing files.
## this is to fool the automounter
cd ${HOME}
This command does a cd to your home directory so that pwd prints
out your /u/username pathname and not the longer ``real'' (and
confusing) path name.
hope that helps..........