From 1b1128bc76a66be1fcf941c68aa710efeb76f3c5 Mon Sep 17 00:00:00 2001 From: hjp Date: Fri, 18 Nov 2005 08:39:10 +0000 Subject: [PATCH] Find preppath even if it isn't in the initial path (e.g. when called from cron). --- .zshenv | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.zshenv b/.zshenv index 641a143..d831647 100644 --- a/.zshenv +++ b/.zshenv @@ -35,19 +35,29 @@ then . /etc/oraenv fi -if whence preppath > /dev/null +# don't rely on a sane path at this point: +for i in /usr/bin/preppath /usr/local/bin/preppath +do + if [ -x $i ] + then + preppath=$i + break; + fi +done + +if [ -n "$preppath" ] then if [ -r /etc/PATH ] then - PATH=$(preppath $(cat /etc/PATH) ) + PATH=$($preppath $(cat /etc/PATH) ) fi # first prepend important stuff - PATH=`preppath -c $ORACLE_HOME/bin` - PATH=`preppath -c /usr/bin/X11:/bin:/usr/bin:/usr/ccs/bin:/opt/perl5/bin:/usr/games:/usr/contrib/bin` - PATH=`preppath -c /usr/local/sbin:/usr/local/samba/bin:/usr/local/bin:/usr/local/bin/X11:/usr/local/majordomo/bin:/usr/lib/majordomo/bin:/usr/local/vnc_x86_linux_2.0:/usr/local/rrdtool-1.0.35/bin` - PATH=`preppath -c /usr/sbin:/sbin:/opt/omni/sbin:/opt/omni/lbin:/var/qmail/bin:/usr/local/ssl/bin:/usr/adm/acct/wsr/bin:/opt/tusc/bin` - PATH=`preppath -c $HOME/bin/hosts:$HOME/bin` + PATH=`$preppath -c $ORACLE_HOME/bin` + PATH=`$preppath -c /usr/bin/X11:/bin:/usr/bin:/usr/ccs/bin:/opt/perl5/bin:/usr/games:/usr/contrib/bin` + PATH=`$preppath -c /usr/local/sbin:/usr/local/samba/bin:/usr/local/bin:/usr/local/bin/X11:/usr/local/majordomo/bin:/usr/lib/majordomo/bin:/usr/local/vnc_x86_linux_2.0:/usr/local/rrdtool-1.0.35/bin` + PATH=`$preppath -c /usr/sbin:/sbin:/opt/omni/sbin:/opt/omni/lbin:/var/qmail/bin:/usr/local/ssl/bin:/usr/adm/acct/wsr/bin:/opt/tusc/bin` + PATH=`$preppath -c $HOME/bin/hosts:$HOME/bin` # then append less important stuff PATH=`apppath -c /opt/Navisphere/bin`