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 # --- Set up some simple aliases ---
111 alias which="command -v"
112 alias ssync="rsync -e ssh"
113 alias rootly=$__MDW_ROOTLY
115 alias re="rootly $EDITOR"
116 alias pstree="pstree -Ghl"
117 alias cdtmp='cd ${TMPDIR-/tmp}'
118 alias pushtmp='pushd ${TMPDIR-/tmp}'
120 alias svn="svnwrap svn"
123 # --- Make `xt' start an xterm, maybe logging into a remote host ---
128 local remote=${1#@} title
130 if [ $# -gt 0 ]; then
131 title="xterm [$remote] $1"
133 title="xterm [$remote]"
135 (xterm -title "$title" -e ssh $remote "$@" &)
143 # --- Turning on and off core dumps ---
148 ulimit -Sc `ulimit -Hc`
156 0) echo "Core dumps disabled" ;;
157 unlimited) echo "Core dumps enabled" ;;
158 *) echo "Core dump limit is $l blocks" ;;
162 echo >&2 "usage: core [yn]"
168 # --- Fix `man' under Slowaris ---
178 case "$arg" in [0-9]*) man[i+=1]="-s" ;; esac
181 command man "${man[@]}"
186 # --- For `root' use -- some simple molly-guards ---
188 if (( UID == 0 )); then
189 alias rm='rm -i' cp='cp -i' mv='mv -i'