From 5cc06ca537a2f1f9373bfc91dccea38775ac4575 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 8 May 2009 18:55:34 +0000 Subject: Change path setup git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@387 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- zshrc | 61 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 26 deletions(-) (limited to 'zshrc') diff --git a/zshrc b/zshrc index 4c33fe1..e8254f9 100644 --- a/zshrc +++ b/zshrc @@ -205,36 +205,45 @@ fi -PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:$PATH" -if [ -d /sw/bin ] ; then - PATH="/sw/bin:${PATH}" -fi -if [ -d $HOME/bin ] ; then - PATH="${HOME}/bin:${PATH}" -fi -if [ -d $HOME/local/bin ] ; then - PATH="${HOME}/local/bin:${PATH}" -fi -if [ -d $HOME/local/amd64/bin ] && [ "$ARCH" = "x86_64" ] ; then - PATH="${HOME}/local/amd64/bin:${PATH}" -fi -if [ -d $HOME/local/i386/bin ] && [ "$ARCH" = "i386" ] ; then - PATH="${HOME}/local/i386/bin:${PATH}" -fi -if [ -d /usr/lib/ccache ] ; then - PATH="/usr/lib/ccache:${PATH}" -elif [ -d /usr/lib/compilercache ] ; then - PATH="/usr/lib/compilercache:${PATH}" -fi +# SETUP PATH +############ +path=( + "$HOME/bin" + "$HOME/local/bin" + /usr/lib/ccache + /usr/local/bin + /usr/bin + /bin + /usr/bin/X11 + /usr/games + /sw/bin + "$path[@]" +) if [ "`id -u`" = "0" ] || ! [ -x /usr/bin/id ] ; then PATH="/usr/local/sbin:/usr/sbin:/sbin:${PATH}" + path=( + /usr/local/sbin + /usr/sbin + /sbin + "$path[@]" + ) fi -typeset -U PATH +export PATH +# Only unique entries please. +typeset -U path +# Remove entries that don't exist on this system. Just for sanity's +# sake more than anything. +path=( ${^path}(N-/) ) + + + +#MANPATH="/usr/share/man:/usr/local/share/man:/usr/local/man:$MANPATH" +#if [ -d $HOME/local/share/man ] ; then +# MANPATH="${HOME}/local/share/man:${MANPATH}" +#fi + + -MANPATH="/usr/share/man:/usr/local/share/man:/usr/local/man:$MANPATH" -if [ -d $HOME/local/share/man ] ; then - MANPATH="${HOME}/local/share/man:${MANPATH}" -fi # we want colorful listings zmodload -i zsh/complist -- cgit v1.2.3