public
Description: dotfiles and utilities accumulated over the years which I want on most of my Mac/Linux systems
Homepage:
Clone URL: git://github.com/acdha/unix_tools.git
unix_tools / etc / bash_profile
100644 85 lines (69 sloc) 1.831 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Functions used in this file:
__has_parent_dir () {
    # Utility function so we can test for things like .git/.hg without firing
    # up a separate process
    test -d "$1" && return 0;
 
    current="."
    while [ ! "$current" -ef "$current/.." ]; do
        if [ -d "$current/$1" ]; then
            return 0;
        fi
        current="$current/..";
    done
 
    return 1;
}
 
__vcs_name() {
if [ -d .svn ]; then
echo " [svn]";
elif [ -d RCS ]; then
echo " [RCS]";
    elif __has_parent_dir ".git"; then
        echo "$(__git_ps1 ' [git %s]')";
    elif __has_parent_dir ".hg"; then
        echo " [hg $(hg branch)]"
fi
}
 
PS1='\[\033]0;\u@\h:\w\007\]\u@\h:\w$(__vcs_name) $ '
shopt -s histappend
PROMPT_COMMAND='history -a'
MANPATH=~/man:$MANPATH
 
export PIP_REQUIRE_VIRTUALENV=true
 
if [ ! -z `which virtualenvwrapper_bashrc 2>/dev/null` ]; then
    export WORKON_HOME=$HOME/.virtualenvs
    export PIP_VIRTUALENV_BASE=$WORKON_HOME
    . `which virtualenvwrapper_bashrc`
fi
 
if [ -f /etc/bash_completion.d/* ]; then
for c in /etc/bash_completion.d/*; do
. "$c"
done
fi
 
if [ -f ~/.bash_completion.d/* ]; then
for c in ~/.bash_completion.d/*; do
. "$c"
done
fi
 
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi
 
source ~/.bashrc
 
if [ -f ~/.bashrc.local ]; then
    . ~/.bashrc.local
fi
 
if [ -f ~/.pythonstartup ]; then
    export PYTHONSTARTUP=$HOME/.pythonstartup
fi
 
if [ -d /opt/local ]; then
    export MANPATH=/opt/local/share/man:$MANPATH
    export PATH=/opt/local/sbin:/opt/local/bin:$PATH
fi
 
if [ -d /usr/local/git ]; then
    export MANPATH=/usr/local/git/man:$MANPATH
    export PATH=/usr/local/git/bin:$PATH
fi
 
PS1='\[\033]0;\u@\h:\w\007\]\u@\h:\w$(__vcs_name) $ '
shopt -s histappend
PROMPT_COMMAND='history -a'
MANPATH=~/man:$MANPATH
HISTCONTROL=ignorespace:ignoredups
HISTSIZE=2000