#!/bin/bash ################################################################################ # # File: $RCSfile: set_path,v $ # Revision: $Revision: 1.8 $ # Description: Sets the path from scratch # Author: Andrew@DeFaria.com # Created: Thu Jun 6 08:31:57 PDT 1996 # Modified: $Date: 2012/09/20 18:10:28 $ # Language: bash # # (c) Copyright 2000-2005, Andrew@DeFaria.com, all rights reserved. # ################################################################################ function append_to_path { component="$1" if [ -d "$component" ]; then if [ -z "$PATH" ]; then PATH="$component" else PATH="$PATH:$component" fi fi } # append_to_path function prepend_to_path { component="$1" if [ -d "$component" ]; then PATH="$component:$PATH" fi } # prepend_to_path function append_to_manpath { component="$1" if [ -d "$component" ]; then if [ -z "$MANPATH" ]; then MANPATH="$component" else MANPATH="$MANPATH:$component" fi fi } # append_to_manpath if [ -x /app/manpath ]; then OLDIFS=$IFS IFS=: for manpath in $(/app/manpath); do manpath_dirs="$manpath_dirs $manpath" done IFS=$OLDIFS fi # Set up PATH path_dirs= if [ -f /etc/PATH ]; then OLDIFS=$IFS IFS=: for path in $(cat /etc/PATH); do path_dirs="$path_dirs $path" done IFS=$OLDIFS fi if [ "$SYSTEMROOT" ]; then systemroot=$(cygpath -u $SYSTEMROOT) fi path_dirs="$path_dirs\ .\ "$HOME/bin"\ $adm_base/bin\ $adm_base/cc\ $adm_base/cq\ $adm_base/cvsbin\ /opt/Rational/Clearcase/bin\ /opt/Rational/ClearQuest\ /opt/Rational/Common\ /usr/local/mysql/bin\ /usr/local/maps/bin\ /usr/local/ddts/bin\ /usr/local/bin\ /usr/afsws/bin\ /usr/afsws\ /usr/xpg4/bin\ /bin\ /sbin\ /usr/bin\ /usr/games\ /usr/X11R6/bin\ /usr/bin/X11\ /usr/dt/bin\ /usr/openwin/bin\ /usr/kerberos/bin\ /opt/rational/clearcase/bin\ /opt/rational/clearquest/bin\ /opt/ibm/rationalsdlc/clearcase/bin\ /opt/ibm/rationalsdlc/clearcase/etc\ /opt/ibm/rationalsdlc/clearquest/bin\ /opt/ibm/rationalsdlc/clearquest\ /opt/ibm/rationalsdlc/common\ /opt/mycroft-core/bin\ /opt/perforce/bin\ /opt/perforce/sbin\ /usr/sbin\ /usr/ccs/bin\ /usr/seos/bin\ /usr/ucb\ /opt/ssh/bin\ /tools/bin\ /snap/bin\ /System/bin\ /opt/bin\ $systemroot/System32\ $systemroot\ " manpath_dirs="\ /usr/share/man\ /usr/dt/man\ /usr/dt/man/man1\ /usr/cns/man\ /usr/local/packages/ccperl/ccperl5.001m/man\ /usr/local/packages/atria/current/man\ /usr/local/packages/emacs/man\ /usr/seos/man\ /opt/ssh/man\ /opt/medusa/share/man\ /usr/afsws/man\ " PATH= for component in $path_dirs; do append_to_path "$component" done # Set up MANPATH if [ -f /etc/MANPATH ]; then MANPATH=$(cat /etc/MANPATH) fi for component in $manpath_dirs; do append_to_manpath "$component" done # Set up SHLIB_PATH if [ "hp-ux" = "10" ]; then export SHLIB_PATH=$(cat /etc/SHLIB_PATH) export SHLIB_PATH=$SHLIB_PATH:$M_LROOT/bin export LD_LIBRARY_PATH=$SHLIB_PATH:$M_LROOT/bin fi