diff .bashrc @ 51:44c36681ca0f

* Removed many double quotes from tests; they caused the tests to pass on the CentOS 5.5 hosts but fail on Macs. Without the quotes they work properly everywhere tested. * Added tests for Intel compiler paths already existing, as well as Condor * New aliases: pine, ldm, lds, ldsloop, hostmaster
author huston@80426f53-59d1-405d-934b-f07cd76f4a1a
date Fri, 03 Jun 2011 18:56:35 +0000
parents 8d204a89b981
children 5ae5253cbcc1
line wrap: on
line diff
--- a/.bashrc	Sat May 21 14:46:13 2011 +0000
+++ b/.bashrc	Fri Jun 03 18:56:35 2011 +0000
@@ -26,7 +26,7 @@
 export GEM_HOME=$HOME/Installs/rubygems/gems
 
 # If this is an xterm set the title to user@host:dir
-case "$TERM" in
+case $TERM in
   xterm*|rxvt*)
     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
     ;;
@@ -42,14 +42,14 @@
 for P in /sbin /usr/sbin /usr/local/bin /usr/local/sbin \
   /opt/local/bin /opt/local/sbin /usr/X11R6/bin; do
   if [ -d $P ]; then
-    [[ "$PATH" =~ "(^|:)$P($|:)" ]] || \
+    [[ $PATH =~ (^|:)$P($|:) ]] || \
     export PATH=${P}${PATH:+:$PATH}
   fi
 done
 
 for M in /usr/local/share/man /usr/local/man /opt/local/share/man ; do
   if [ -d $M ]; then
-    [[ "$MANPATH" =~ "(^|:)$M($|:)" ]] || \
+    [[ $MANPATH =~ (^|:)$M($|:) ]] || \
     export MANPATH=${M}${MANPATH:+:$MANPATH}
   fi
 done
@@ -57,32 +57,32 @@
 # Local Perl install
 if [ -d $HOME/perl ]; then
   if [ -d $HOME/perl/lib/perl5 ]; then
-    [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib/perl5($|:)" ]] || \
+    [[ $PERL5LIB =~ (^|:)$HOME/perl/lib/perl5($|:) ]] || \
     export PERL5LIB=$HOME/perl/lib/perl5${PERL5LIB:+:$PERL5LIB}
   fi
 
   if [ -d $HOME/perl/lib64/perl5 ]; then
-    [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib64/perl5($|:)" ]] || \
+    [[ $PERL5LIB =~ (^|:)$HOME/perl/lib64/perl5($|:) ]] || \
     export PERL5LIB=$HOME/perl/lib64/perl5${PERL5LIB:+:$PERL5LIB}
   fi
 
   if [ -d $HOME/perl/lib/perl5/site_perl ]; then
-    [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib/perl5/site_perl($|:)" ]] || \
+    [[ $PERL5LIB =~ (^|:)$HOME/perl/lib/perl5/site_perl($|:) ]] || \
     export PERL5LIB=$HOME/perl/lib/perl5/site_perl${PERL5LIB:+:$PERL5LIB}
   fi
 
   if [ -d $HOME/perl/lib64/perl5/site_perl ]; then
-    [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib64/perl5/site_perl($|:)" ]] || \
+    [[ $PERL5LIB =~ (^|:)$HOME/perl/lib64/perl5/site_perl($|:) ]] || \
     export PERL5LIB=$HOME/perl/lib64/perl5/site_perl${PERL5LIB:+:$PERL5LIB}
   fi
 
   if [ -d $HOME/perl/share/man ]; then
-    [[ "$MANPATH" =~ "(^|:)$HOME/perl/share/man($|:)" ]] || \
+    [[ $MANPATH =~ (^|:)$HOME/perl/share/man($|:) ]] || \
     export MANPATH=$HOME/perl/share/man:${MANPATH:+$MANPATH}
   fi
 
   if [ -d $HOME/perl/bin ]; then
-    [[ "$PATH" =~ "(^|:)$HOME/perl/bin($|:)" ]] || \
+    [[ $PATH =~ (^|:)$HOME/perl/bin($|:) ]] || \
     export PATH=$HOME/perl/bin${PATH:+:$PATH}
   fi
 fi
@@ -93,17 +93,17 @@
 # './configure --prefix=$HOME/Installs'
 for D in $HOME/Installs/* ; do
   if [ -d $D/bin ]; then 
-    [[ "$PATH" =~ "(^|:)$D/bin($|:)" ]] || \
+    [[ $PATH =~ (^|:)$D/bin($|:) ]] || \
     export PATH=$D/bin${PATH:+:$PATH}
   fi
 
   if [ -d $D/share/man ]; then 
-    [[ "$MANPATH" =~ "(^|:)$D/share/man($|:)" ]] || \
+    [[ $MANPATH =~ (^|:)$D/share/man($|:) ]] || \
     export MANPATH=$D/share/man:${MANPATH:+$MANPATH}
   fi
   
   if [ -d $D/man ]; then 
-    [[ "$MANPATH" =~ "(^|:)$D/man($|:)" ]] || \
+    [[ $MANPATH =~ (^|:)$D/man($|:) ]] || \
     export MANPATH=$D/man:${MANPATH:+$MANPATH}
   fi
 done
@@ -120,37 +120,41 @@
     ;;
 esac
 [[ "$INTEL_ARCH" ]] && {
-  [[ -f /usr/peyton/intel/11.0/bin/iccvars.sh ]] && \
-    . /usr/peyton/intel/11.0/bin/iccvars.sh $INTEL_ARCH
-  [[ -f /usr/peyton/intel/11.0/bin/ifortvars.sh ]] && \
-    . /usr/peyton/intel/11.0/bin/ifortvars.sh $INTEL_ARCH
+  [[ $PATH =~ (^|:)/usr/peyton/intel ]] || {
+    [[ -f /usr/peyton/intel/11.0/bin/iccvars.sh ]] && \
+     . /usr/peyton/intel/11.0/bin/iccvars.sh $INTEL_ARCH
+    [[ -f /usr/peyton/intel/11.0/bin/ifortvars.sh ]] && \
+     . /usr/peyton/intel/11.0/bin/ifortvars.sh $INTEL_ARCH
+  }
 }
 
-[[ -f /u/condor/condor-setup.sh ]] && {
-  export PATH=${PATH:+$PATH:}/u/condor/hosts/`hostname -s`/sbin
-  . /u/condor/condor-setup.sh
-}
+if [ -f /u/condor/condor-setup.sh ]; then
+  [[ $PATH =~ (^|:)/u/condor/hosts/`hostname -s`/sbin($|:) ]] || {
+    export PATH=${PATH:+$PATH:}/u/condor/hosts/`hostname -s`/sbin
+    . /u/condor/condor-setup.sh
+  }
+fi
 
 # Now make sure $HOME/bin is top of the list (or at least present)
 if [ -d $HOME/bin ]; then
-  [[ "$PATH" =~ "(^|:)$HOME/bin($|:)" ]] || \
+  [[ $PATH =~ (^|:)$HOME/bin($|:) ]] || \
   export PATH=$HOME/bin${PATH:+:$PATH}
 fi
 
 # Last, make sure to end MANPATH with a ':' to force include of system paths
 # (some versions of man take care of this, but it doesn't hurt to have it
 # anyway)
-[[ "$MANPATH" =~ ":$" ]] || export MANPATH=$MANPATH:
+[[ $MANPATH =~ :$ ]] || export MANPATH=$MANPATH:
 
 # Store MIBs in ~/mibs and they'll be added here.  Can nest directories
 # (they'll be searched).
 if [ -d $HOME/mibs ]; then
   for D in `find $HOME/mibs -type d` ; do
-    [[ "$MIBDIRS" =~ "(^\+|:)$D($|:)" ]] || \
+    [[ $MIBDIRS =~ (^\+|:)$D($|:) ]] || \
     export MIBDIRS=${MIBDIRS:+$MIBDIRS:}$D
   done
 
-  [[ "$MIBDIRS" =~ "^\+" ]] || export MIBDIRS=+$MIBDIRS
+  [[ $MIBDIRS =~ ^\+ ]] || export MIBDIRS=+$MIBDIRS
   export MIBS=ALL
 fi