Skip to content

Commit

Permalink
Correcting set up of environment variables. EOM
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisher committed Feb 26, 2010
1 parent 323f443 commit d998a7e
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 42 deletions.
48 changes: 40 additions & 8 deletions bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,56 @@ fi
# System Environment Variables

# source the system wide bashrc if it exists
if [ -e /etc/bash.bashrc ] ; then
source /etc/bash.bashrc
if [[ $OS == Windows* ]] ; then
if [ -e /etc/bash.bashrc ] ; then
source /etc/bash.bashrc
fi
else
if [ -e /etc/bashrc ] ; then
source /etc/bashrc
fi
fi

# source the system wide bashrc if it exists

# Set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
export PATH=~/bin:$PATH
fi

if [ -d ~/bin/emacs/bin ] ; then
export PATH=~/bin/emacs/bin:$PATH
fi

# Set MANPATH so it includes users' private man if it exists
if [ -d ~/share/man ]; then
MANPATH=~/share/man:$MANPATH
fi

# Set INFOPATH so it includes users' private info if it exists
if [ -d ~/info ]; then
if [ -d ~/info ] ; then
INFOPATH=~/share/info:$INFOPATH
fi

# MacPorts
if [ -d /opt/local ] ; then
export PATH=/opt/local/bin:$PATH
export MANPATH=/opt/local/man:$MANPATH
fi

# Emacs
if [[ $OS == Windows* ]] ; then
if [ -d ~/bin/emacs/bin ] ; then
export PATH=~/bin/emacs/bin:$PATH
fi
else
if [ -d /Applications/MacPorts/Emacs.app/Contents/MacOS/bin ] ; then
export PATH=/Applications/MacPorts/Emacs.app/Contents/MacOS/bin:$PATH
fi
fi

# Git
# Turn on advanced git bash completion if the file exists
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi

# Notes: ----------------------------------------------------------
# When you start an interactive shell (log in, open terminal or iTerm in OS X,
# or create a new tab in iTerm) the following files are read and run, in this order:
Expand All @@ -49,8 +76,13 @@ fi
# Hello Messsage
echo -e "Kernel Information: " `uname -smr`
echo -e "`bash --version`"
systeminfo | fgrep -i 'system up time'
if [[ $OS == Windows* ]] ; then
systeminfo | fgrep -i 'system up time'
else
echo -ne "Uptime: "; uptime
fi
echo -ne "Server time is: "; date
echo -e "\nPATH: $PATH"
echo -e "\nMANPATH: $MANPATH"
echo -e "\nAliases:\n"; alias

61 changes: 27 additions & 34 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,25 @@

# System Environment Variables

# source the system wide bashrc if it exists
if [ -e /etc/bashrc ] ; then
source /etc/bashrc
fi

# Set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
export PATH=~/bin:$PATH
fi

# MacPorts
if [ -d /opt ] ; then
export PATH=/opt/local/bin:$PATH
export MANPATH=/opt/local/man:$MANPATH
# If this shell is interactive, turn on programmable completion enhancements.
# Any completions you add in ~/.bash_completion are sourced last.
case $- in
*i*) [[ -f /opt/local/etc/bash_completion ]] && . /opt/local/etc/bash_completion ;;
esac
alias scr='cd ~; screen -h 50000'
fi

if [ -d /Applications/MacPorts/Emacs.app/Contents/MacOS/bin ] ; then
export PATH=/Applications/MacPorts/Emacs.app/Contents/MacOS/bin:$PATH
fi

# Set MANPATH so it includes users' private man if it exists
if [ -d ~/share/man ]; then
export MANPATH=~/share/man:$MANPATH
if [[ $OS == Windows* ]] ; then
unset TMP
unset TEMP
# Any completions you add in ~/.bash_completion are sourced last.
case $- in
*i*) [[ -f /etc/bash_completion ]] && . /etc/bash_completion ;;
esac
alias scr='cd ~; screen -h 50000 -s /bin/bash'
else
# MacPorts
if [ -d /opt ] ; then
# If this shell is interactive, turn on programmable completion enhancements.
# Any completions you add in ~/.bash_completion are sourced last.
case $- in
*i*) [[ -f /opt/local/etc/bash_completion ]] && . /opt/local/etc/bash_completion ;;
esac
fi

alias scr='cd ~; screen -h 50000'
fi

# Shell Options
Expand All @@ -48,6 +38,14 @@ shopt -s histappend
# for example, cd /vr/lgo/apaache would find /var/log/apache
shopt -s cdspell

# Ignore some controlling instructions
# HISTIGNORE is a colon-delimited list of patterns which should be excluded.
# The '&' is a special pattern which suppresses duplicate entries.
export HISTIGNORE=$'[ \t]*:&:[fb]g:exit'

# Whenever displaying the prompt, write the previous line to disk
export PROMPT_COMMAND="history -a"

# Colors
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
alias ls='ls -FG'
Expand All @@ -57,11 +55,6 @@ export HISTCONTROL="ignoredups"

# Git -------------------------------------------------------------

# Turn on advanced git bash completion if the file exists
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi

GIT_PS1_SHOWDIRTYSTATE=1

alias g='git'
Expand Down

0 comments on commit d998a7e

Please sign in to comment.