From 3d2cd251f6d0b92567ad4d93d2ec54bfea856634 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 19 Jun 2013 22:46:07 +1200 Subject: Set up my environment vars correctly --- bash/bash_profile | 5 ++++- bash/bashrc | 29 ----------------------------- bash/profile | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 bash/profile (limited to 'bash') diff --git a/bash/bash_profile b/bash/bash_profile index 0447bddd..28f71bf9 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -1,3 +1,6 @@ -# Just source .bashrc if it exists. +# Source the normal shell profile. +[[ -e "${HOME}/.profile" ]] && source "${HOME}/.profile" + +# Then source .bashrc if it exists. [[ -e "${HOME}/.bashrc" ]] && source "${HOME}/.bashrc" diff --git a/bash/bashrc b/bash/bashrc index c062e20c..a9062e49 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -1,13 +1,6 @@ # Don't do anything if not running interactively. [[ -z "$PS1" ]] && return -# Use the system's implementation of vi as my text editor. -export EDITOR=vi -export VISUAL=$EDITOR - -# Use less as my pager if available. -hash less &>/dev/null && export PAGER=less - # Keep plenty of history. HISTFILESIZE=1000000 HISTSIZE=1000000 @@ -18,9 +11,6 @@ HISTCONTROL=ignoreboth # Keep the times of the commands in history. HISTTIMEFORMAT='%F %T ' -# Don't check for mail all the time, it's irritating. -unset MAILCHECK - # Autocorrect fudged paths in cd calls. shopt -s cdspell &>/dev/null @@ -66,22 +56,6 @@ hash stty &>/dev/null && stty -ixon # Use completion, if available. [[ -e /etc/bash_completion ]] && source /etc/bash_completion -# Add various binary paths if they exist -pathdirs="${HOME}/.local/bin - ${HOME}/bin - /usr/local/apache/bin - /usr/local/mysql/bin - /usr/local/nagios/bin - /usr/local/pgsql/bin" -for pathdir in $pathdirs; do - [[ -d "$pathdir" ]] \ - && export PATH="${pathdir}:${PATH}" -done - -# Add home directory manual path if it exists -[[ -d "${HOME}/.local/share/man" ]] \ - && export MANPATH="${HOME}/.local/share/man:${MANPATH}" - # Figure out how many colors we have now. hash tput && colors=$(tput colors) @@ -126,9 +100,6 @@ if grep --help | grep -- --exclude-dir &>/dev/null; then grepopts="${grepopts} --exclude-dir=.{cvs,git,hg,svn}" fi -# Use UTF-8 linedrawing for passwd -export TREE_CHARSET='utf-8' - # Alias ls and grep with the options we've collected. alias ls="ls ${lsopts}" alias grep="grep ${grepopts}" diff --git a/bash/profile b/bash/profile new file mode 100644 index 00000000..3729c8a7 --- /dev/null +++ b/bash/profile @@ -0,0 +1,40 @@ +# Locale +export LANG='en_NZ.UTF-8' +export LANGUAGE='en_NZ:en' +unset LC_ALL + +# Editor +export EDITOR='vi' +export VISUAL="$EDITOR" + +# Pager +export PAGER='less' + +# Mail +export MAIL="$HOME/Mail" + +# Browser +if [ -n "$DISPLAY" ]; then + export BROWSER='firefox' +else + export BROWSER='lynx' +fi + +# Path +for bindir in \ + "$HOME/.local/bin" \ + '/usr/local/apache/bin' \ + '/usr/local/mysql/bin' \ + '/usr/local/nagios/bin' \ + '/usr/local/pgsql/bin' +do + [ -d "$bindir" ] && export PATH="$bindir:$PATH" +done + +# Manuals +[ -d "$HOME/.local/share/man" ] \ + && export MANPATH="$HOME/.local/share/man" + +# Tree +export TREE_CHARSET='utf-8' + -- cgit v1.2.3