From 4321f21261354034c34a666d5e37c7cff5c053df Mon Sep 17 00:00:00 2001 From: hjp Date: Sat, 19 Jul 1997 14:25:48 +0000 Subject: [PATCH] Major speedup in constructing path: Replaced "if egrep" with "case". --- .zlogin | 1 + .zprofile | 9 +++++++++ .zshenv | 19 ++++++++++++++----- GNUmakefile | 25 ++++++++++++++++++------- 4 files changed, 42 insertions(+), 12 deletions(-) diff --git a/.zlogin b/.zlogin index 1f508d0..2addb6e 100644 --- a/.zlogin +++ b/.zlogin @@ -4,3 +4,4 @@ if [ "`uname`" = "HP-UX" ] then ps -fu $LOGNAME fi +date diff --git a/.zprofile b/.zprofile index d7176be..82d43cf 100644 --- a/.zprofile +++ b/.zprofile @@ -5,3 +5,12 @@ if [ -f "$EXEC" ] then source $EXEC fi +sock=`findsock $$` +if [ -z "$sock" ] +then + vhost=`hostname` +else + vhost="$sock" +fi +vhost=`echo "$vhost" | cut -d . -f 1` + diff --git a/.zshenv b/.zshenv index 0a2146b..8a14b8e 100644 --- a/.zshenv +++ b/.zshenv @@ -40,7 +40,7 @@ export LPDEST=wsrplj51 # set PATH to direcories *I* want. PRIVATE_PATH=/usr/local/alpha/mt/bin:$HOME/bin/scripts:$HOME/bin -ETC_PATH=/usr/local/etc:/usr/etc:/etc:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/samba/bin +ETC_PATH=/usr/local/etc:/usr/etc:/etc:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/samba/bin:/opt/omni/sbin:/opt/omni/lbin BIN_PATH=/usr/local/bin:/usr/softbench/bin:/usr/vue/bin:/usr/bin/X11:/bin:/usr/bin:/usr/local/bin/X11 if [ -r /etc/PATH ] then @@ -50,24 +50,33 @@ fi ALL_PATH=$PRIVATE_PATH:$ETC_PATH:$BIN_PATH:$PATH NEW_PATH="" +date for i in ${(s/:/)ALL_PATH} do if test -d "$i" then - if echo "$NEW_PATH" | egrep '(^|:)'"$i"'(:|$)' > /dev/null - then - else + case "$NEW_PATH" in + $i:*|*:$i|*:$i:*) ;; + *) if test -z "$NEW_PATH" then NEW_PATH=$i else NEW_PATH=$NEW_PATH:$i fi - fi + esac fi done export PATH=$NEW_PATH +date + +if [ -r /etc/MANPATH ] +then + MANPATH=`cat /etc/MANPATH`:$MANPATH +fi + + case "`uname -sr`" in HP-UX*09.*) export LANG=${LANG:-american.iso88591} diff --git a/GNUmakefile b/GNUmakefile index 1cc6174..8927dc7 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,12 +1,23 @@ include GNUmakerules -install: \ - $(HOME)/.zlogin \ - $(HOME)/.zlogout \ - $(HOME)/.znewterm \ - $(HOME)/.zprofile \ - $(HOME)/.zshenv \ - $(HOME)/.zshrc +ALLSRC = \ + .zlogin \ + .zlogout \ + .znewterm \ + .zprofile \ + .zshenv \ + .zshrc \ + +ALLDST = $(subst ., $(HOME)/., $(ALLSRC)) + +install: $(ALLDST) + +echo: + echo $(ALLSRC) + echo $(ALLDST) $(HOME)/%: % $(INSTALL) $^ $@ + +diff: + for i in $(ALLSRC); do diff -u $(HOME)/$$i $$i; done