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