Mercurial > index.cgi > dotfiles
comparison .bashrc @ 30:ca6c77fe843b
* Whitespace (ugh)
* Test for presence of directories before adding them to paths
* Update Intel compilers to 11.0
author | huston@80426f53-59d1-405d-934b-f07cd76f4a1a |
---|---|
date | Mon, 01 Feb 2010 19:33:19 +0000 |
parents | a6c93cf45e90 |
children | a93f5d5278f3 |
comparison
equal
deleted
inserted
replaced
29:b6e22d12945b | 30:ca6c77fe843b |
---|---|
6 # shells. | 6 # shells. |
7 | 7 |
8 | 8 |
9 # Source global definitions | 9 # Source global definitions |
10 if [ -f /etc/bashrc ]; then | 10 if [ -f /etc/bashrc ]; then |
11 . /etc/bashrc | 11 . /etc/bashrc |
12 fi | 12 fi |
13 | 13 |
14 # User specific aliases and functions | 14 # User specific aliases and functions |
15 if [ -f $HOME/.bash_aliases ]; then | 15 if [ -f $HOME/.bash_aliases ]; then |
16 . $HOME/.bash_aliases | 16 . $HOME/.bash_aliases |
17 fi | 17 fi |
18 | 18 |
19 # | 19 # |
20 # Environment variables | 20 # Environment variables |
21 # | 21 # |
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 ;; |
35 esac | 35 esac |
36 | 36 |
37 # | 37 # |
38 # Paths | 38 # Paths |
39 # | 39 # |
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 ; do | 43 /opt/local/bin /opt/local/sbin ; do |
44 [[ "$PATH" =~ "(^|:)$P($|:)" ]] || \ | 44 if [ -d $P ]; then |
45 export PATH=${P}${PATH:+:$PATH} | 45 [[ "$PATH" =~ "(^|:)$P($|:)" ]] || \ |
46 export PATH=${P}${PATH:+:$PATH} | |
47 fi | |
46 done | 48 done |
47 | 49 |
48 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 |
49 [[ "$MANPATH" =~ "(^|:)$M($|:)" ]] || \ | 51 if [ -d $M ]; then |
50 export MANPATH=${M}${MANPATH:+:$MANPATH} | 52 [[ "$MANPATH" =~ "(^|:)$M($|:)" ]] || \ |
53 export MANPATH=${M}${MANPATH:+:$MANPATH} | |
54 fi | |
51 done | 55 done |
52 | 56 |
53 # Local Perl install | 57 # Local Perl install |
54 if [ -d $HOME/perl ]; then | 58 if [ -d $HOME/perl ]; then |
55 [[ "$PERL5LIB" =~ "(^|:)$HOME/perl($|:)" ]] || \ | 59 [[ "$PERL5LIB" =~ "(^|:)$HOME/perl($|:)" ]] || \ |
56 export PERL5LIB=$HOME/perl${PERL5LIB:+:$PERL5LIB} | 60 export PERL5LIB=$HOME/perl${PERL5LIB:+:$PERL5LIB} |
57 | 61 |
58 if [ -d $HOME/perl/share/man ]; then | 62 if [ -d $HOME/perl/share/man ]; then |
59 [[ "$MANPATH" =~ "(^|:)$HOME/perl/share/man($|:)" ]] || \ | 63 [[ "$MANPATH" =~ "(^|:)$HOME/perl/share/man($|:)" ]] || \ |
60 export MANPATH=$HOME/perl/share/man:${MANPATH:+$MANPATH} | 64 export MANPATH=$HOME/perl/share/man:${MANPATH:+$MANPATH} |
61 fi | 65 fi |
62 | 66 |
63 if [ -d $HOME/perl/bin ]; then | 67 if [ -d $HOME/perl/bin ]; then |
64 [[ "$PATH" =~ "(^|:)$HOME/perl/bin($|:)" ]] || \ | 68 [[ "$PATH" =~ "(^|:)$HOME/perl/bin($|:)" ]] || \ |
65 export PATH=$HOME/perl/bin${PATH:+:$PATH} | 69 export PATH=$HOME/perl/bin${PATH:+:$PATH} |
66 fi | 70 fi |
67 fi | 71 fi |
68 | 72 |
69 # Local install paths - install things to $HOME/Installs directories, and | 73 # Local install paths - install things to $HOME/Installs directories, and |
70 # they will automatically get the proper paths added. Most things | 74 # they will automatically get the proper paths added. Most things |
71 # that use autoconf will do this with | 75 # that use autoconf will do this with |
72 # './configure --prefix=$HOME/Installs' | 76 # './configure --prefix=$HOME/Installs' |
73 for D in $HOME/Installs/* ; do | 77 for D in $HOME/Installs/* ; do |
74 if [ -d $D/bin ]; then | 78 if [ -d $D/bin ]; then |
75 [[ "$PATH" =~ "(^|:)$D/bin($|:)" ]] || \ | 79 [[ "$PATH" =~ "(^|:)$D/bin($|:)" ]] || \ |
76 export PATH=$D/bin${PATH:+:$PATH} | 80 export PATH=$D/bin${PATH:+:$PATH} |
77 fi | 81 fi |
78 | 82 |
79 if [ -d $D/share/man ]; then | 83 if [ -d $D/share/man ]; then |
80 [[ "$MANPATH" =~ "(^|:)$D/share/man($|:)" ]] || \ | 84 [[ "$MANPATH" =~ "(^|:)$D/share/man($|:)" ]] || \ |
81 export MANPATH=$D/share/man:${MANPATH:+$MANPATH} | 85 export MANPATH=$D/share/man:${MANPATH:+$MANPATH} |
82 fi | 86 fi |
83 | 87 |
84 if [ -d $D/man ]; then | 88 if [ -d $D/man ]; then |
85 [[ "$MANPATH" =~ "(^|:)$D/man($|:)" ]] || \ | 89 [[ "$MANPATH" =~ "(^|:)$D/man($|:)" ]] || \ |
86 export MANPATH=$D/man:${MANPATH:+$MANPATH} | 90 export MANPATH=$D/man:${MANPATH:+$MANPATH} |
87 fi | 91 fi |
88 done | 92 done |
89 | 93 |
90 # Add-ons for Intel compilers at work, and Condor | 94 # Add-ons for Intel compilers at work, and Condor |
91 [[ -f /usr/peyton/intel/10.1/cc64/bin/iccvars.sh ]] && \ | 95 [[ -f /usr/peyton/intel/11.0/bin/iccvars.sh ]] && \ |
92 . /usr/peyton/intel/10.1/cc64/bin/iccvars.sh | 96 . /usr/peyton/intel/11.0/bin/iccvars.sh |
93 [[ -f /usr/peyton/intel/10.1/fc64/bin/ifortvars.sh ]] && \ | 97 [[ -f /usr/peyton/intel/11.0/bin/ifortvars.sh ]] && \ |
94 . /usr/peyton/intel/10.1/fc64/bin/ifortvars.sh | 98 . /usr/peyton/intel/11.0/bin/ifortvars.sh |
95 [[ -f /u/condor/condor-setup.sh ]] && { | 99 [[ -f /u/condor/condor-setup.sh ]] && { |
96 export PATH=${PATH:+$PATH:}/u/condor/hosts/`hostname -s`/sbin | 100 export PATH=${PATH:+$PATH:}/u/condor/hosts/`hostname -s`/sbin |
97 . /u/condor/condor-setup.sh | 101 . /u/condor/condor-setup.sh |
98 } | 102 } |
99 | 103 |
100 # Now make sure $HOME/bin is top of the list (or at least present) | 104 # Now make sure $HOME/bin is top of the list (or at least present) |
101 if [ -d $HOME/bin ]; then | 105 if [ -d $HOME/bin ]; then |
102 [[ "$PATH" =~ "(^|:)$HOME/bin($|:)" ]] || \ | 106 [[ "$PATH" =~ "(^|:)$HOME/bin($|:)" ]] || \ |
103 export PATH=$HOME/bin${PATH:+:$PATH} | 107 export PATH=$HOME/bin${PATH:+:$PATH} |
104 fi | 108 fi |
105 | 109 |
106 # Last, make sure to end MANPATH with a ':' to force include of system paths | 110 # Last, make sure to end MANPATH with a ':' to force include of system paths |
107 # (some versions of man take care of this, but it doesn't hurt to have it | 111 # (some versions of man take care of this, but it doesn't hurt to have it |
108 # anyway) | 112 # anyway) |
109 [[ "$MANPATH" =~ ":$" ]] || export MANPATH=$MANPATH: | 113 [[ "$MANPATH" =~ ":$" ]] || export MANPATH=$MANPATH: |
110 | 114 |
111 # Store MIBs in ~/mibs and they'll be added here. Can nest directories | 115 # Store MIBs in ~/mibs and they'll be added here. Can nest directories |
112 # (they'll be searched). | 116 # (they'll be searched). |
113 if [ -d $HOME/mibs ]; then | 117 if [ -d $HOME/mibs ]; then |
114 for D in `find $HOME/mibs -type d` ; do | 118 for D in `find $HOME/mibs -type d` ; do |
115 [[ "$MIBDIRS" =~ "(^\+|:)$D($|:)" ]] || \ | 119 [[ "$MIBDIRS" =~ "(^\+|:)$D($|:)" ]] || \ |
116 export MIBDIRS=${MIBDIRS:+$MIBDIRS:}$D | 120 export MIBDIRS=${MIBDIRS:+$MIBDIRS:}$D |
117 done | 121 done |
118 | 122 |
119 [[ "$MIBDIRS" =~ "^\+" ]] || export MIBDIRS=+$MIBDIRS | 123 [[ "$MIBDIRS" =~ "^\+" ]] || export MIBDIRS=+$MIBDIRS |
120 export MIBS=ALL | 124 export MIBS=ALL |
121 fi | 125 fi |