2 # $Id: .bashrc,v 1.6 1996/12/08 20:33:42 mdw Exp $
7 if [ -z "$__mdw_bashrc" ]; then
11 [ -z "$__mdw_profile" -a -r $HOME/.bash_profile ] && . $HOME/.bash_profile
12 [ -r /etc/bashrc ] && . /etc/bashrc
14 # --- First of all, set up the prompt string ---
18 if [ "$TERM" = "dumb" ]; then
19 if (( EUID == 0 )); then PS1="# "; else PS1="\$ "; fi
25 linux*|screen*|xterm*|vt100*)
26 bold='\[
\e[1m\]' unbold='\[
\e[m\]' nl='\[
\r\]' ;;
28 bold='' unbold='' nl='' ;;
31 if (( EUID == 0 )); then
33 elif [ "$__mdw_tty" = "`tty`" ]; then
37 export __mdw_tty="`tty`"
40 if [ -z "$SSH_CLIENT" ] &&
41 [ "$__mdw_sechost" != "`hostname`" ]
46 PS1="$nl$bold$left$sec_l\\h$sec_r \\w$right$unbold"
47 PS2="$PS1 $bold>$unbold "
52 # --- Little preferences ---
62 shopt -s expand_aliases
69 shopt -s interactive_comments
75 shopt -u shift_verbose
78 # --- Set the CDPATH ---
80 # CDPATH=~/src:/usr/src:/usr/lib:/usr/share
83 # while (( i > 0 )); do
84 # CDPATH=$CDPATH:$dots
90 # --- Some colour `ls' support ---
92 [ "${TMPDIR+yes}" ] || eval `tmpdir -b`
93 if [ -x /usr/bin/dircolors -o -x /usr/local/bin/dircolors ] &&
94 [ "$TERM" != "dumb" ]; then
95 eval `dircolors -b ~/.dircolors`
102 command ls $LS_OPTIONS ${LS_COLORS+--color=auto} "$@"
108 # --- Setting xterm titles ---
110 # This doesn't work so well any more. :-(
112 # if [ -e /usr/lib/bash/xtitle.so ]; then
113 # enable -f /usr/lib/bash/xtitle.so xtitle
114 # elif [ -e /usr/local/lib/xtitle.so ]; then
115 # enable -f /usr/local/lib/xtitle.so xtitle
116 # elif [ -e $HOME/lib/bash/xtitle.so ]; then
117 # enable -f $HOME/lib/bash/xtitle.so xtitle
119 # xtitle () { return 1; }
121 xtitle () { return 1; }
124 local t="`xtitle -q`" st
132 # --- Set up some simple aliases ---
135 alias which="command -v"
136 alias ssync="rsync -e ssh"
137 alias rootly="entitle root become -g0 root"
139 alias eh="entitle 'Egham Hills 90210' tf eh"
140 alias news="entitle Usenet slrn"
141 alias splitvt='splitvt -t "`xtitle -q || echo xterm` splitvt"'
142 alias pstree="pstree -Ghl"
143 alias cdtmp='cd ${TMPDIR-/tmp}'
144 alias pushtmp='pushd ${TMPDIR-/tmp}'
145 alias e="sensible-editor"
146 alias svn="svnwrap svn"
149 local t="`xtitle -q`" host="$1"
156 # --- Make `xt' start an xterm, maybe logging into a remote host ---
161 local remote=${1#@} title
163 if [ $# -gt 0 ]; then
164 title="xterm [$remote] $1"
166 title="xterm [$remote]"
168 (xterm -title "$title" -e ssh $remote "$@" &)
176 # --- Turning on and off core dumps ---
181 ulimit -Sc `ulimit -Hc`
189 0) echo "Core dumps disabled" ;;
190 unlimited) echo "Core dumps enabled" ;;
191 *) echo "Core dump limit is $l blocks" ;;
195 echo >&2 "usage: core [yn]"
201 # --- Fix `man' under Slowaris ---
211 case "$arg" in [0-9]*) man[i+=1]="-s" ;; esac
214 command man "${man[@]}"
219 # --- For `root' use -- some simple molly-guards ---
221 if (( UID == 0 )); then
222 alias rm='rm -i' cp='cp -i' mv='mv -i'