Create symlink from ~/.bash_profile for login shell to activate my ~/.bashrc.
# Bash and Zsh common env var settings. -*- sh -*-
# set -x
# set -u
export EDITOR=vim
# XXX vim and gnome-terminal have support for 256 colours in fedora 8 at least
# Note debian/ubuntu users should install the ncurses-term package to support this
# export TERM=xterm-256color
if [[ $OSTYPE = cygwin ]]; then
# Avoid permission problem in Cygwin.
umask 0000
fi
export TIME_STYLE=long-iso
# Easy cd to often used dirs.
export CDPATH=.:$HOME:$HOME/work:$HOME/my:$HOME/Documents
my_path_prune() {
if [[ :$1: =~ (.*):$2: ]]; then
local left=${BASH_REMATCH[1]}
local right=${1:$((${#left} + ${#2} + 1))}
[[ ${left:0:1} = : ]] && left=${left:1}
[[ ${right: -1} = : ]] && right=${right:0: -1}
if [[ -z $left ]]; then
my_path_prune=$right
elif [[ -z $right ]]; then
my_path_prune=$left
else
my_path_prune=$left:$right
fi
else
my_path_prune=$1
fi
}
my_path_preappend() {
my_path_prune "$PATH" "$1"
PATH=$1:$my_path_prune
}
# For my "cygrun.exe" wrapper to work it should be behind shebang scripts in the PATH.
my_path_preappend ~/usr/bin
# ~/.local/bin is default PATH for "pip install --user $PKG".
my_path_preappend ~/.local/bin
my_path_preappend /usr/local/bin
my_path_preappend /usr/bin
my_path_preappend /bin
my_path_preappend /usr/sbin
my_path_preappend /sbin
export PATH
unset -f my_path_preappend
unset -f my_path_prune
unset -v my_path_prune
if [[ -z $LD_LIBRARY_PATH ]]; then
LD_LIBRARY_PATH=$HOME/usr/lib
elif [[ :$LD_LIBRARY_PATH: != *:$HOME/usr/lib:* ]]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":$HOME/usr/lib
fi
case $OSTYPE in
netbsd*) ;; # Do nothing, because NetBSD uses non-GNU man.
*)
if [[ -z $MANPATH ]]; then
export MANPATH=$HOME/usr/share/man:
elif [[ :$MANPATH: != *:$HOME/usr/share/man:* ]]; then
export MANPATH=$MANPATH:$HOME/usr/share/man:
fi
;;
esac
if [[ -z $INFOPATH ]]; then
export INFOPATH=$HOME/usr/share/info:
elif [[ :$INFOPATH: != *:$HOME/usr/share/info:* ]]; then
export INFOPATH=$INFOPATH:$HOME/usr/share/info:
fi
export PYTHONSTARTUP=$HOME/.pystartup
if [[ :$PATH: != *:$HOME/.local/npm:* && $OSTYPE != cygwin ]]; then
export PATH=$PATH:$HOME/.local/npm
fi
export RLWRAP_HOME=$HOME/.rlwrap
unset xopt