comparison .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
comparison
equal deleted inserted replaced
50:407b3bac9cb0 51:44c36681ca0f
24 export EDITOR=vim 24 export EDITOR=vim
25 export RUBYLIB=$HOME/Installs/rubygems/lib 25 export RUBYLIB=$HOME/Installs/rubygems/lib
26 export GEM_HOME=$HOME/Installs/rubygems/gems 26 export GEM_HOME=$HOME/Installs/rubygems/gems
27 27
28 # If this is an xterm set the title to user@host:dir 28 # If this is an xterm set the title to user@host:dir
29 case "$TERM" in 29 case $TERM in
30 xterm*|rxvt*) 30 xterm*|rxvt*)
31 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"' 31 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
32 ;; 32 ;;
33 *) 33 *)
34 ;; 34 ;;
40 # Standard-ish paths; some of these may be in place already, but if 40 # Standard-ish paths; some of these may be in place already, but if
41 # they're not they should probably go near the front of the pack. 41 # they're not they should probably go near the front of the pack.
42 for P in /sbin /usr/sbin /usr/local/bin /usr/local/sbin \ 42 for P in /sbin /usr/sbin /usr/local/bin /usr/local/sbin \
43 /opt/local/bin /opt/local/sbin /usr/X11R6/bin; do 43 /opt/local/bin /opt/local/sbin /usr/X11R6/bin; do
44 if [ -d $P ]; then 44 if [ -d $P ]; then
45 [[ "$PATH" =~ "(^|:)$P($|:)" ]] || \ 45 [[ $PATH =~ (^|:)$P($|:) ]] || \
46 export PATH=${P}${PATH:+:$PATH} 46 export PATH=${P}${PATH:+:$PATH}
47 fi 47 fi
48 done 48 done
49 49
50 for M in /usr/local/share/man /usr/local/man /opt/local/share/man ; do 50 for M in /usr/local/share/man /usr/local/man /opt/local/share/man ; do
51 if [ -d $M ]; then 51 if [ -d $M ]; then
52 [[ "$MANPATH" =~ "(^|:)$M($|:)" ]] || \ 52 [[ $MANPATH =~ (^|:)$M($|:) ]] || \
53 export MANPATH=${M}${MANPATH:+:$MANPATH} 53 export MANPATH=${M}${MANPATH:+:$MANPATH}
54 fi 54 fi
55 done 55 done
56 56
57 # Local Perl install 57 # Local Perl install
58 if [ -d $HOME/perl ]; then 58 if [ -d $HOME/perl ]; then
59 if [ -d $HOME/perl/lib/perl5 ]; then 59 if [ -d $HOME/perl/lib/perl5 ]; then
60 [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib/perl5($|:)" ]] || \ 60 [[ $PERL5LIB =~ (^|:)$HOME/perl/lib/perl5($|:) ]] || \
61 export PERL5LIB=$HOME/perl/lib/perl5${PERL5LIB:+:$PERL5LIB} 61 export PERL5LIB=$HOME/perl/lib/perl5${PERL5LIB:+:$PERL5LIB}
62 fi 62 fi
63 63
64 if [ -d $HOME/perl/lib64/perl5 ]; then 64 if [ -d $HOME/perl/lib64/perl5 ]; then
65 [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib64/perl5($|:)" ]] || \ 65 [[ $PERL5LIB =~ (^|:)$HOME/perl/lib64/perl5($|:) ]] || \
66 export PERL5LIB=$HOME/perl/lib64/perl5${PERL5LIB:+:$PERL5LIB} 66 export PERL5LIB=$HOME/perl/lib64/perl5${PERL5LIB:+:$PERL5LIB}
67 fi 67 fi
68 68
69 if [ -d $HOME/perl/lib/perl5/site_perl ]; then 69 if [ -d $HOME/perl/lib/perl5/site_perl ]; then
70 [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib/perl5/site_perl($|:)" ]] || \ 70 [[ $PERL5LIB =~ (^|:)$HOME/perl/lib/perl5/site_perl($|:) ]] || \
71 export PERL5LIB=$HOME/perl/lib/perl5/site_perl${PERL5LIB:+:$PERL5LIB} 71 export PERL5LIB=$HOME/perl/lib/perl5/site_perl${PERL5LIB:+:$PERL5LIB}
72 fi 72 fi
73 73
74 if [ -d $HOME/perl/lib64/perl5/site_perl ]; then 74 if [ -d $HOME/perl/lib64/perl5/site_perl ]; then
75 [[ "$PERL5LIB" =~ "(^|:)$HOME/perl/lib64/perl5/site_perl($|:)" ]] || \ 75 [[ $PERL5LIB =~ (^|:)$HOME/perl/lib64/perl5/site_perl($|:) ]] || \
76 export PERL5LIB=$HOME/perl/lib64/perl5/site_perl${PERL5LIB:+:$PERL5LIB} 76 export PERL5LIB=$HOME/perl/lib64/perl5/site_perl${PERL5LIB:+:$PERL5LIB}
77 fi 77 fi
78 78
79 if [ -d $HOME/perl/share/man ]; then 79 if [ -d $HOME/perl/share/man ]; then
80 [[ "$MANPATH" =~ "(^|:)$HOME/perl/share/man($|:)" ]] || \ 80 [[ $MANPATH =~ (^|:)$HOME/perl/share/man($|:) ]] || \
81 export MANPATH=$HOME/perl/share/man:${MANPATH:+$MANPATH} 81 export MANPATH=$HOME/perl/share/man:${MANPATH:+$MANPATH}
82 fi 82 fi
83 83
84 if [ -d $HOME/perl/bin ]; then 84 if [ -d $HOME/perl/bin ]; then
85 [[ "$PATH" =~ "(^|:)$HOME/perl/bin($|:)" ]] || \ 85 [[ $PATH =~ (^|:)$HOME/perl/bin($|:) ]] || \
86 export PATH=$HOME/perl/bin${PATH:+:$PATH} 86 export PATH=$HOME/perl/bin${PATH:+:$PATH}
87 fi 87 fi
88 fi 88 fi
89 89
90 # Local install paths - install things to $HOME/Installs directories, and 90 # Local install paths - install things to $HOME/Installs directories, and
91 # they will automatically get the proper paths added. Most things 91 # they will automatically get the proper paths added. Most things
92 # that use autoconf will do this with 92 # that use autoconf will do this with
93 # './configure --prefix=$HOME/Installs' 93 # './configure --prefix=$HOME/Installs'
94 for D in $HOME/Installs/* ; do 94 for D in $HOME/Installs/* ; do
95 if [ -d $D/bin ]; then 95 if [ -d $D/bin ]; then
96 [[ "$PATH" =~ "(^|:)$D/bin($|:)" ]] || \ 96 [[ $PATH =~ (^|:)$D/bin($|:) ]] || \
97 export PATH=$D/bin${PATH:+:$PATH} 97 export PATH=$D/bin${PATH:+:$PATH}
98 fi 98 fi
99 99
100 if [ -d $D/share/man ]; then 100 if [ -d $D/share/man ]; then
101 [[ "$MANPATH" =~ "(^|:)$D/share/man($|:)" ]] || \ 101 [[ $MANPATH =~ (^|:)$D/share/man($|:) ]] || \
102 export MANPATH=$D/share/man:${MANPATH:+$MANPATH} 102 export MANPATH=$D/share/man:${MANPATH:+$MANPATH}
103 fi 103 fi
104 104
105 if [ -d $D/man ]; then 105 if [ -d $D/man ]; then
106 [[ "$MANPATH" =~ "(^|:)$D/man($|:)" ]] || \ 106 [[ $MANPATH =~ (^|:)$D/man($|:) ]] || \
107 export MANPATH=$D/man:${MANPATH:+$MANPATH} 107 export MANPATH=$D/man:${MANPATH:+$MANPATH}
108 fi 108 fi
109 done 109 done
110 110
111 # Add-ons for Intel compilers at work, and Condor 111 # Add-ons for Intel compilers at work, and Condor
118 x86_64) 118 x86_64)
119 INTEL_ARCH="intel64" 119 INTEL_ARCH="intel64"
120 ;; 120 ;;
121 esac 121 esac
122 [[ "$INTEL_ARCH" ]] && { 122 [[ "$INTEL_ARCH" ]] && {
123 [[ -f /usr/peyton/intel/11.0/bin/iccvars.sh ]] && \ 123 [[ $PATH =~ (^|:)/usr/peyton/intel ]] || {
124 . /usr/peyton/intel/11.0/bin/iccvars.sh $INTEL_ARCH 124 [[ -f /usr/peyton/intel/11.0/bin/iccvars.sh ]] && \
125 [[ -f /usr/peyton/intel/11.0/bin/ifortvars.sh ]] && \ 125 . /usr/peyton/intel/11.0/bin/iccvars.sh $INTEL_ARCH
126 . /usr/peyton/intel/11.0/bin/ifortvars.sh $INTEL_ARCH 126 [[ -f /usr/peyton/intel/11.0/bin/ifortvars.sh ]] && \
127 . /usr/peyton/intel/11.0/bin/ifortvars.sh $INTEL_ARCH
128 }
127 } 129 }
128 130
129 [[ -f /u/condor/condor-setup.sh ]] && { 131 if [ -f /u/condor/condor-setup.sh ]; then
130 export PATH=${PATH:+$PATH:}/u/condor/hosts/`hostname -s`/sbin 132 [[ $PATH =~ (^|:)/u/condor/hosts/`hostname -s`/sbin($|:) ]] || {
131 . /u/condor/condor-setup.sh 133 export PATH=${PATH:+$PATH:}/u/condor/hosts/`hostname -s`/sbin
132 } 134 . /u/condor/condor-setup.sh
135 }
136 fi
133 137
134 # Now make sure $HOME/bin is top of the list (or at least present) 138 # Now make sure $HOME/bin is top of the list (or at least present)
135 if [ -d $HOME/bin ]; then 139 if [ -d $HOME/bin ]; then
136 [[ "$PATH" =~ "(^|:)$HOME/bin($|:)" ]] || \ 140 [[ $PATH =~ (^|:)$HOME/bin($|:) ]] || \
137 export PATH=$HOME/bin${PATH:+:$PATH} 141 export PATH=$HOME/bin${PATH:+:$PATH}
138 fi 142 fi
139 143
140 # Last, make sure to end MANPATH with a ':' to force include of system paths 144 # Last, make sure to end MANPATH with a ':' to force include of system paths
141 # (some versions of man take care of this, but it doesn't hurt to have it 145 # (some versions of man take care of this, but it doesn't hurt to have it
142 # anyway) 146 # anyway)
143 [[ "$MANPATH" =~ ":$" ]] || export MANPATH=$MANPATH: 147 [[ $MANPATH =~ :$ ]] || export MANPATH=$MANPATH:
144 148
145 # Store MIBs in ~/mibs and they'll be added here. Can nest directories 149 # Store MIBs in ~/mibs and they'll be added here. Can nest directories
146 # (they'll be searched). 150 # (they'll be searched).
147 if [ -d $HOME/mibs ]; then 151 if [ -d $HOME/mibs ]; then
148 for D in `find $HOME/mibs -type d` ; do 152 for D in `find $HOME/mibs -type d` ; do
149 [[ "$MIBDIRS" =~ "(^\+|:)$D($|:)" ]] || \ 153 [[ $MIBDIRS =~ (^\+|:)$D($|:) ]] || \
150 export MIBDIRS=${MIBDIRS:+$MIBDIRS:}$D 154 export MIBDIRS=${MIBDIRS:+$MIBDIRS:}$D
151 done 155 done
152 156
153 [[ "$MIBDIRS" =~ "^\+" ]] || export MIBDIRS=+$MIBDIRS 157 [[ $MIBDIRS =~ ^\+ ]] || export MIBDIRS=+$MIBDIRS
154 export MIBS=ALL 158 export MIBS=ALL
155 fi 159 fi
156 160
157 # Display todo list 161 # Display todo list
158 [[ "$PS1" && -f $HOME/.todo ]] && cat $HOME/.todo 162 [[ "$PS1" && -f $HOME/.todo ]] && cat $HOME/.todo