1 ################################################################################
3 # File: $RCSfile: bash_login,v $
4 # Revision: $Revision: 1.29 $
5 # Description: bash startup file
6 # Author: Andrew@DeFaria.com
7 # Created: Mon Aug 20 17:35:01 2001
8 # Modified: $Date: 2013/06/13 14:04:55 $
11 # (c) Copyright 2000-2005, Andrew@DeFaria.com, all rights reserved.
13 ################################################################################
14 # Set ARCHITECTURE of the machine
16 if [[ $KERNEL = CYGWIN* ]]; then
17 export ARCHITECTURE=cygwin
18 elif [ $KERNEL = "Linux" ]; then
19 export ARCHITECTURE=linux
20 elif [ $KERNEL = "SunOS" ]; then
21 export ARCHITECTURE=sun
22 elif [ $KERNEL = "FreeBSD" ]; then
23 export ARCHITECTURE=$KERNEL
25 export ARCHITECTURE=''
26 echo "Warning: Unknown architecture ($KERNEL)"
29 # Architectual differences (AKA Silly Sun)
30 if [ $ARCHITECTURE = "sun" ]; then
31 alias id=/usr/xpg4/bin/id
32 alias tr=/usr/xpg4/bin/tr
34 export id=/usr/xpg4/bin/id
38 if [ -f "$HOME/.rc/set_colors" ]; then
39 source "$HOME/.rc/set_colors"
41 echo "Warning: ~/.rc/set_colors does not exist!"
44 # Check to see if we're interactive
45 if [[ $- = *i* ]]; then
46 export interactive=true
48 export interactive=false
54 if [ "$TERM" = "" -o \
55 "$TERM" = "unknown" -o \
56 "$TERM" = "dialup" -o \
57 "$TERM" = "network" ]; then
58 if [ "$interactive" = "true" ]; then
59 eval $(ttytype -s -a -t ansi -t hp)
63 # System dependent variables.
64 if [ -f "$HOME/.rc/system" ]; then
65 source "$HOME/.rc/system"
67 echo "Warning ~/.rc/system does not exist!"
68 export SYSNAME="*Unknown Systemname*:"
72 # Note: I don't like doing this but an alias doesn't work...
73 if [ $ARCHITECTURE = "sun" ]; then
81 if [ "$interactive" = "true" ]; then
82 stty tostop intr ^C kill ^X susp ^Z erase ^H -inpck -istrip -ixany -echok -echonl
86 adm_base=${adm_base:-/opt/clearscm}
89 adm_fpath=${adm_fpath:-$adm_base/functions}
92 if [ -f "$adm_fpath/common" ]; then
93 source "$adm_fpath/common"
95 : echo "Warning: Cannot find $adm_fpath/common!"
98 # Source bash_completion (if present) (too slow for Windows)
99 if [ -r /etc/bash_completion -a $ARCHITECTURE != "cygwin" ]; then
100 source /etc/bash_completion
103 if [ -x ~/.rc/logout ]; then
104 trap "~/.rc/logout" 0
108 if [ -f ~/.rc/clearcase ]; then
109 source ~/.rc/clearcase
113 if [ -f ~/.rc/multisite ]; then
114 source ~/.rc/multisite
118 if [ -f ~/.rc/git ]; then
122 # Import shell functions:
123 if [ -f ~/.rc/functions ]; then
124 source ~/.rc/functions
135 if [ $ARCHITECTURE = "FreeBSD" ]; then
138 if [ -f ~/.rc/dircolors ]; then
139 if type -p dircolors > /dev/null; then
140 eval $(dircolors -b ~/.rc/dircolors)
144 if [ $ARCHITECTURE = "sun" ]; then
145 # Ugh! --color doesn't work on braindead SUN
148 alias ls="ls -F --color=auto"
153 alias whence="type -p"
156 if [ $ARCHITECTURE = "cygwin" ]; then
162 if [ $(type -p vim) ]; then
166 if [ $(type -p ncftp) ]; then
168 alias ftpput=ncftpput
169 alias ftpget=ncftpget
172 #alias grep="grep -d skip"
174 if [ "$TERM" = "hpterm" -o \
176 "$TERM" = "dtterm" -o \
177 "$TERM" = "sun-color" -o \
178 "$TERM" = "vt100" -o \
179 "$TERM" = "vt220" -o \
180 "$TERM" = "xterm" -o \
181 "$TERM" = "cygwin" ]; then
188 if [ -x $(type -p less) ]; then
189 export LESS=eiXP"?f%f :[stdin] .?pt(%pt\%):?bt(%bt bytes):-.."
190 alias more="less -sr"
191 export PAGER="less -sr"
197 export PS4='${0##*/} line $LINENO:'
202 if [ "$TERM" = "dtterm" ]; then
208 export MAIL=/var/mail/$USER
211 export PERLCRITIC=~/.rc/perlcriticrc
212 export PERLTIDY=~/.rc/perltidyrc
217 alias vbs="cscript //nologo"
220 if [ -f ~/.rc/set_path ]; then
221 source ~/.rc/set_path
223 echo "Warning: ~/.rc/set_path does not exist!"
226 # Color man pages with yellow keywords
227 export LESS_TERMCAP_md=$'\e[1;33m'
229 # If /opt/clearscm/lib is around then set PERL5LIB
230 if [ -d /opt/clearscm/lib ]; then
231 export PERL5LIB="$PERL5LIB:/opt/clearscm/lib"
234 # Client specific customizations
235 for script in $(\ls ~/.rc/client_scripts); do
236 # This is not working as long as ACLs are not supported from the remote
237 # NetApp. This happens at some clients where the home directory is on a
238 # Netapp and they do not support NTFS ACLs properly. We cannot determine
239 # if the script is executable.
240 #if [ ! -d ~/.rc/client_scripts/$script ]; then
241 if [ -x ~/.rc/client_scripts/$script -a \
242 ! -d ~/.rc/client_scripts/$script ]; then
243 source ~/.rc/client_scripts/$script
247 # Set display to local
248 export DISPLAY=${DISPLAY:-:0}
250 # Now go home (in case we were not autmatically cd'ed there)
251 if [ $(id -u) -ne 0 ]; then