[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to add dir to path



Hi,

        Here is how my path is set.  I use zsh.

--8<---------------cut here---------------start------------->8---
## What directories should we be looking for?
COMMON_SYS_DIRS=(/bin /usr/bin /sbin /usr/sbin /usr/local/sbin /usr/games)
case "$MY_SYS_TYPE" in
    hppa1.1-hp-hpux*)
        SYS_DIRS=(/bin/posix /usr/contrib/bin /usr/contrib/games)
        export MORE=-l
        ;;
    mips-dec-ultrix*)
    # Don't make useless coredump files.  If you want a coredump,
    # say "ulimit -c unlimited" and then cause a segmentation fault.
        ulimit -c 0; # ulimit only has afnp on HP's
        SYS_DIRS=( /usr/new /usr/ucb )
        export MORE=-l
        ;;
    alpha-dec-osf*)
        export MORE=-e;
        SYS_DIRS=( /usr/ucb /usr/local/bin/AF )
        ulimit -c 0; 
        ;;
    *)
        ;;
esac

SYS_BIN=( ${^COMMON_SYS_DIRS}(-/NF^M) ${^SYS_DIRS}(-/NF^M) )

# Default directories from my home 
DEFAULT_DIRS=($default_dir/bin/$MY_SYS_TYPE $default_dir/sbin $default_dir/bin)
MY_BIN=( ${^DEFAULT_DIRS}(-/NF^M) )

## Local directories
LOCAL_DIRS=(/usr/local/bin /usr/local/scripts)
LOCAL_BIN=( ${^LOCAL_DIRS}(-/NF^M) )

## Where to find the X stuff
X11_DIRS=( /usr/X11R6/bin /usr/X11R5/bin /usr/X386/bin 
           /usr/local/bin/X11 /usr/bin/X11) 
X11_BIN=( ${^X11_DIRS}(-/NF^M) )

## Where to find the TeX stuff
TEX_DIRS=(/usr/local/share/teTeX/bin/$MY_SYS_TYPE )
TEX_BIN=( ${^TEX_DIRS}(-/NF^M) )

path=( $MY_BIN $LOCAL_BIN $SYS_BIN $X11_BIN $TEX_BIN )
--8<---------------cut here---------------end--------------->8---

        manoj
-- 
The American nation in the sixth ward is a fine people; they love the
eagle -- on the back of a dollar. -- Finlay Peter Dunne
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C



Reply to: