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
36 u="" left="[" right="]"
39 u="\\u@" left="{" right="}"
42 if [ "$__mdw_tty" = "`tty`" ]; then
45 export __mdw_tty="`tty`"
49 if [ -z "$SSH_CLIENT" ] &&
50 [ "$__mdw_sechost" != "`hostname`" ]
55 PS1="$nl$bold$left$sec_l$u\\h$sec_r \\w$right$unbold"
56 PS2="$PS1 $bold>$unbold "
61 # --- Little preferences ---
71 shopt -s expand_aliases
78 shopt -s interactive_comments
84 shopt -u shift_verbose
87 # --- Set the CDPATH ---
89 # CDPATH=~/src:/usr/src:/usr/lib:/usr/share
92 # while (( i > 0 )); do
93 # CDPATH=$CDPATH:$dots
99 # --- Some colour `ls' support ---
101 [ "${TMPDIR+yes}" ] || eval `tmpdir -b`
102 if [ -x /usr/bin/dircolors -o -x /usr/local/bin/dircolors ] &&
103 [ "$TERM" != "dumb" ]; then
104 eval `dircolors -b ~/.dircolors`
111 command ls $LS_OPTIONS ${LS_COLORS+--color=auto} "$@"
117 # --- Set up some simple aliases ---
120 alias which="command -v"
121 alias ssync="rsync -e ssh"
122 alias rootly=$__MDW_ROOTLY
124 alias re="rootly $EDITOR"
125 alias pstree="pstree -Ghl"
126 alias cdtmp='cd ${TMPDIR-/tmp}'
127 alias pushtmp='pushd ${TMPDIR-/tmp}'
129 alias svn="svnwrap svn"
132 # --- Make `xt' start an xterm, maybe logging into a remote host ---
137 local remote=${1#@} title
139 if [ $# -gt 0 ]; then
140 title="xterm [$remote] $1"
142 title="xterm [$remote]"
144 (xterm -title "$title" -e ssh $remote "$@" &)
152 # --- Turning on and off core dumps ---
157 ulimit -Sc `ulimit -Hc`
165 0) echo "Core dumps disabled" ;;
166 unlimited) echo "Core dumps enabled" ;;
167 *) echo "Core dump limit is $l blocks" ;;
171 echo >&2 "usage: core [yn]"
177 # --- Fix `man' under Slowaris ---
187 case "$arg" in [0-9]*) man[i+=1]="-s" ;; esac
190 command man "${man[@]}"
195 # --- For `root' use -- some simple molly-guards ---
197 if (( UID == 0 )); then
198 alias rm='rm -i' cp='cp -i' mv='mv -i'