source: trunk/packs/dotfiles/bashrc @ 20679

Revision 20679, 6.9 KB checked in by rbasch, 20 years ago (diff)
On Solaris, add /usr/sfw/bin and /usr/sfw/man to the PATH and MANPATH, respectively.
Line 
1# Global bashrc file
2#
3# $Id: bashrc,v 1.31 2004-09-11 16:52:11 rbasch Exp $
4
5# This file is sourced by default user file ~/.bashrc
6
7initdir=/usr/athena/lib/init
8
9
10
11# *******************   ENVIRONMENT SETUP   *******************
12
13
14
15# Set up standard system/user environment configuration (including setup of
16# environment variables, attachment of lockers, and setting of search path)
17
18if [ "${ENV_SET:+set}" != set ]; then
19
20        export ENV_SET=t                        # Avoid unnecessary repeat
21        export HOSTTYPE="`/bin/athena/machtype`"
22
23        umask 077                               # Strictly protect files
24                                                #  (does not apply in AFS)
25        ulimit -c unlimited                     # Don't allow coredumps
26        export EDITOR=emacs                     # Set default editor
27        export VISUAL=emacs                     # Set default screen editor
28        export MM_CHARSET=iso-8859-1
29
30        # Set standard Athena path variables (generic path for all users).
31        # PATH will get set later after .bash_environment is run.
32        case "$HOSTTYPE" in
33        sgi)
34                athena_path=/usr/athena/bin:/usr/athena/etc:
35                athena_path=$athena_path:/bin/athena:/usr/sbin:/usr/bsd:/sbin
36                athena_path=$athena_path:/usr/bin:/bin:/usr/bin/X11:/usr/etc
37                MANPATH=/usr/athena/man:/usr/freeware/catman:/usr/share/catman
38                MANPATH=$MANPATH:/usr/share/man:/usr/catman:/usr/man
39                ;;
40        sun4)
41                athena_path=/srvd/patch:/usr/athena/bin:/usr/athena/etc
42                athena_path=$athena_path:/bin/athena:/usr/openwin/bin
43                athena_path=$athena_path:/usr/openwin/demo:/usr/dt/bin:/usr/bin
44                athena_path=$athena_path:/usr/ccs/bin:/usr/sbin:/sbin
45                athena_path=$athena_path:/usr/sfw/bin:/usr/ucb
46                MANPATH=/usr/athena/man:/usr/openwin/man:/usr/dt/man:/usr/man
47                MANPATH=$MANPATH:/usr/sfw/man
48                ;;
49        linux)
50                athena_path=/srvd/patch:/usr/athena/bin:/usr/athena/etc
51                athena_path=$athena_path:/bin/athena:/usr/bin:/bin
52                athena_path=$athena_path:/usr/X11R6/bin:/usr/athena/etc
53                athena_path=$athena_path:/usr/sbin:/sbin
54                MANPATH=/usr/athena/man:/usr/share/man:/usr/X11R6/man
55                ;;
56        *)
57                echo "Standard dotfiles do not support system type $HOSTTYPE."
58        esac
59        export MANPATH
60
61        # Default "more" behavior
62        case $HOSTTYPE in
63        sgi)
64                MORE=-se
65                ;;
66        *)
67                MORE=-s
68                ;;
69        esac
70        export MORE
71
72        # Set miscellaneous system-dependent variables.
73        case $HOSTTYPE in
74        sgi)
75                # The following set the default error message format
76                # to omit the label and severity components, per the
77                # standard IRIX /etc/profile.
78                export MSGVERB=text:action
79                export NOMSGLABEL=1
80                export NOMSGSEVERITY=1
81                ;;
82        sun4)
83                export LD_LIBRARY_PATH=/usr/openwin/lib
84                export OPENWINHOME=/usr/openwin
85                ;;
86        linux)
87                # This is to ensure that native programs use the Athena
88                # gconf, ORBit, bonobo-activation, etc. libraries
89                # rather than the native ones.  GNOME programs outside
90                # of /usr/athena/bin may not function properly if it is
91                # not set.
92                export LD_LIBRARY_PATH=/usr/athena/lib
93                ;;
94        esac
95       
96        export ATHENA_SYS=`/bin/athena/machtype -S`
97        export ATHENA_SYS_COMPAT=`/bin/athena/machtype -C`
98
99        if [ -z "$ATHENA_SYS" ]; then
100                export ATHENA_SYS=@sys
101        fi
102
103        if [ "${PRINTER+set}" != set -a -e /var/athena/clusterinfo ]; then
104                PRINTER=`awk '/LPR/ { print $3 }' /var/athena/clusterinfo`
105                if [ -n "$PRINTER" ]; then export PRINTER; fi
106        fi
107
108        # Reset the HOME variable to correspond to the actual location
109        # of the user's home directory.  This will avoid having long
110        # pathnames being printed when /mit/<user> is a symlink to a
111        # path within AFS.
112
113        # Since this code is being invoked only at the beginning of
114        # the session, and prior to the inclusion of any of the user's
115        # other dotfiles, we can assume that the current directory is
116        # the user's home directory.
117
118        x=`/bin/pwd`
119        if [ -n "$x" ]; then
120                export HOME=$x
121        fi
122        unset x
123
124        # Special version of ADD for the .bash_environment file.
125
126        add () {
127                eval "$( /bin/athena/attach -Padd -b -P"$athena_path" "$@" )"
128        }
129
130        # Run user environment customizations identified in your
131        # ~/.bash_environment file.  This is the place to include your
132        # own environment variables, attach commands, and other system
133        # wide setup commands.  You can also cancel default behaviors
134        # listed above.
135        # ~/.bash_environment is not sourced if NOCALLS is set (i.e.,
136        # if you selected the xlogin "Ignore your customizations"
137        # option when you logged in).
138
139        if [ "${NOCALLS+set}" != set -a -r ~/.bash_environment ]; then
140                . ~/.bash_environment
141        fi
142       
143        # On IRIX, limits are reset on exec of a setuid program, e.g.
144        # xterm. So record now what the user wanted coredumpsize to
145        # be so we can fix it later.
146        export COREDUMPSIZE_LIMIT=`ulimit -c`
147
148        # Standard Athena path
149        athena_home_bin=$( /usr/athena/bin/athdir "$HOME" )
150        PATH=${athena_home_bin:+$athena_home_bin:}$athena_path:.
151        unset athena_path athena_home_bin
152
153        # Make sure applications can properly find their appdefs, etc.
154
155        if [ "${XUSERFILESEARCHPATH+set}" != set ]; then
156                XUSERFILESEARCHPATH=/usr/athena/lib/X11/app-defaults/%N
157        else
158                XUSERFILESEARCHPATH=$XUSERFILESEARCHPATH:/usr/athena/lib/X11/app-defaults/%N
159        fi
160
161        if [ sgi = "$HOSTTYPE" -a "${skip_sgi+set}" != set -a "${NOCALLS+set}" != set ]; then
162                XUSERFILESEARCHPATH="$HOME/.desktop-$host/%N:$HOME/.desktop-$host/0.0/%N:$XUSERFILESEARCHPATH"
163        fi
164
165        export XUSERFILESEARCHPATH
166
167
168        if [ sun4 = "$HOSTTYPE" ]; then
169                if [ "${XFILESEARCHPATH+set}" != set ]; then
170                        XFILESEARCHPATH="/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%S"
171                else
172                        XFILESEARCHPATH="$XFILESEARCHPATH:/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%S"
173                fi
174                export XFILESEARCHPATH
175        fi
176fi
177       
178
179# *******************  BASH SETUP   *******************
180
181# Set up standard bash shell initializations
182
183set -o noclobber                # Don't overwrite files with redirection
184
185if [ "${PS1+set}" = set ]; then
186        if [ sgi = "$HOSTTYPE" -a -t 0 ]; then
187                # Have no better way to do this at the moment.
188                stty sane intr ^C
189        fi
190        case $HOME in
191        /var/athena/tmphomedir/*)
192                PS1="athena (temporary homedir)\$ "
193                ;;
194        *)
195                PS1="athena\$ "
196                ;;
197        esac
198        HISTSIZE=20
199        CDPATH=.:~
200fi
201
202# Fix coredumpsize limit in case it was reset
203[ -n "$COREDUMPSIZE_LIMIT" ] && ulimit -c $COREDUMPSIZE_LIMIT
204
205#   alias for re-establishing authentication
206renew () { kinit $USER && fsid -a && zctl load /dev/null ; }
207
208#   alias for a convenient way to change terminal type
209term () { set -f; unset TERMCAP; eval "$( tset -s -I -Q "$@" )"; set +f; }
210
211#   aliases dealing with x window system
212xresize () { set -f; eval "$( resize -u )"; set +f ; }
213
214if [ "${XSESSION+set}" = set ]; then
215        if [ -z "$XSESSION" ]; then
216                logout () { end_session && exit; }              # logout for X
217        else
218                logout () { kill -HUP $XSESSION && exit; }      # logout for X
219        fi
220fi
221
222#   aliases dealing with adding locker programs
223
224add_flags=
225add () { eval "$( /bin/athena/attach -Padd -b $add_flags "$@" )" ; }
226
227alias setup='echo "setup is not supported in bash yet"'
228
229
230# All of the bash initializing commands above can be overridden by using
231# "unset" or "unalias" commands (or by changing things using "set" or
232# "alias" again) in your ~/.bashrc.mine file, which is sourced here.
233# ~/.bashsrc.mine is not sourced if the xlogin "Ignore your customizations"
234# option was selected to begin the session.
235
236if [ "${NOCALLS+set}" != set -a -r ~/.bashrc.mine ]; then
237        . ~/.bashrc.mine
238fi
Note: See TracBrowser for help on using the repository browser.