Sample Configuration for UNIX Shells

 

Intoduction:
The following are some sample configuration files for two different shells, csh (1) and bash (1). Hopefully, you can use these files (as well as the respective man pages) in order to configure your working environment for your account. Believe me, getting comfortable with your UNIX environment now will save you much pain and frustration later...

 

Sample .cshrc:
# @(#)cshrc 1.11 89/11/29 SMI
umask 022
set path=(/bin /usr/bin /usr/sbin /sbin /usr/local/bin /usr/local/sbin /usr/ccs/bin /usr/openwin/bin /usr/ucb /etc .)
set manpath=(/usr/man /usr/share/man /usr/openwin/man /usr/local/man)
if ( $?prompt ) then
	set history=32
endif

alias ll ls -l
alias tar /usr/local/bin/tar
alias ps ps -ef

 

My .cshrc:
The following files comprise how I changed (and configured) my main shell, bash.

umask 077
set path=(/bin /usr/bin /usr/ucb /etc .)
if ( $?prompt ) then
        set history=32
endif
         
exec /usr/local/bin/bash

 

My .bash_profile:
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
          
# User specific environment and startup programs
           
PATH=$PATH:$HOME/bin
ENV=$HOME/.bashrc
USERNAME=""
            
export USERNAME ENV PATH

 

My .bashrc:
PATH="/usr/bin:/sbin:/usr/sbin:/p/gcc-2.8.1:/p/gnu:/p/perl:/p/gdb-4.17/bin:/usr/local/bin:/usr/ccs/bin:/usr/ucb:/usr/openwin/bin:."
MANPATH="/usr/man:/usr/share/man:/usr/openwin/man:/usr/local/man"

alias id="/usr/xpg4/bin/id"

ulimit -c 1000000
if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
	umask 002
else
	umask 077
fi

USER=`id -un`
LOGNAME=$USER
MAIL="/var/mail/$USER"
MAILPATH="/var/mail/$USER"

HOSTNAME=`/bin/hostname`
HISTSIZE=1000
HISTFILESIZE=1000

PS1='\h:\w\$ '

# make the "backspace" key do it's job.
stty erase '^H'

# alias section.
alias tar=/usr/local/bin/tar
alias ls="/usr/bin/ls -F"
alias ll="/usr/bin/ls -la"
alias xt="/usr/openwin/bin/xterm -bg white -ls -fn fixed -sb -sl 1000 -title $HOSTNAME/term"
alias joe=/u/reitz/bin/joe
alias mpg123=/u/reitz/bin/mpg123
alias mxaudio=/u/reitz/bin/mxaudio
alias netscape=/p/www/netscape
alias ssh="/p/ssh/ssh -l $LOGNAME"
alias xlock="/usr/openwin/bin/xlock"

export PATH MANPATH PS1 HOSTNAME HISTSIZE HISTFILESIZE USER LOGNAME MAIL MAILPATH