source: trunk/packs/dotfiles/bashrc @ 13564

Revision 13564, 6.5 KB checked in by danw, 25 years ago (diff)
stash coredumpsize into an environment variable at environment setup time, since Irix resets limits when executing setuid programs (like xterm). Set the limit back to what's in the environment variable in every shell.
Line 
1# Global bashrc file
2#
3# $Id: bashrc,v 1.10 1999-09-10 17:19:40 danw 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 0                             # 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        export MANPAGER="more -s -f"
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:/bin/athena:/usr/sbin
36                athena_path=$athena_path:/usr/bsd:/sbin:/usr/bin:/bin
37                athena_path=$athena_path:/usr/bin/X11:/usr/andrew/bin
38                athena_path=$athena_path:/usr/athena/etc:/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:/bin/athena
44                athena_path=$athena_path:/usr/openwin/bin:/usr/openwin/demo
45                athena_path=$athena_path:/usr/bin:/usr/ccs/bin:/usr/andrew/bin
46                athena_path=$athena_path:/usr/athena/etc:/usr/sbin:/sbin
47                athena_path=$athena_path:/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:/bin/athena:/usr/bin
52                athena_path=$athena_path:/bin:/usr/X11R6/bin:/usr/andrew/bin
53                athena_path=$athena_path:/usr/athena/etc:/usr/sbin:/sbin
54                MANPATH=/usr/athena/man:/usr/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        esac
87       
88        export ATHENA_SYS=`/bin/athena/machtype -S`
89        export ATHENA_SYS_COMPAT=`/bin/athena/machtype -C`
90
91        if [ -z "$ATHENA_SYS" ]; then
92                export ATHENA_SYS=@sys
93        fi
94
95        if [ "${PRINTER+set}" != set -a -e /var/athena/clusterinfo ]; then
96                PRINTER=`awk '/LPR/ { print $3 }' /var/athena/clusterinfo`
97                if [ -n "$PRINTER" ]; then export PRINTER; fi
98        fi
99
100        # Reset the HOME variable to correspond to the actual location
101        # of the user's home directory.  This will avoid having long
102        # pathnames being printed when /mit/<user> is a symlink to a
103        # path within AFS.
104
105        # Since this code is being invoked only at the beginning of
106        # the session, and prior to the inclusion of any of the user's
107        # other dotfiles, we can assume that the current directory is
108        # the user's home directory.
109
110        x=`/bin/pwd`
111        if [ -n "$x" ]; then
112                export HOME=$x
113        fi
114        unset x
115
116        # Special version of ADD for the .bash_environment file.
117
118        add () {
119                eval "$( /bin/athena/attach -Padd -b -P"$athena_path" "$@" )"
120        }
121
122        # Run user environment customizations identified in your
123        # ~/.bash_environment file.  This is the place to include your
124        # own environment variables, attach commands, and other system
125        # wide setup commands.  You can also cancel default behaviors
126        # listed above.
127        # ~/.bash_environment is not sourced if NOCALLS is set (i.e.,
128        # if you selected the xlogin "Ignore your customizations"
129        # option when you logged in).
130
131        if [ "${NOCALLS+set}" != set -a -r ~/.bash_environment ]; then
132                . ~/.bash_environment
133        fi
134       
135        # On IRIX, limits are reset on exec of a setuid program, e.g.
136        # xterm. So record now what the user wanted coredumpsize to
137        # be so we can fix it later.
138        export COREDUMPSIZE_LIMIT=`ulimit -c`
139
140        # Standard Athena path
141        PATH=`athdir $HOME`:$athena_path:.
142        unset athena_path
143
144        # Make sure applications can properly find their appdefs, etc.
145
146        if [ "${XUSERFILESEARCHPATH+set}" != set ]; then
147                XUSERFILESEARCHPATH=/usr/athena/lib/X11/app-defaults/%N
148        else
149                XUSERFILESEARCHPATH=$XUSERFILESEARCHPATH:/usr/athena/lib/X11/app-defaults/%N
150        fi
151
152        if [ sgi = "$HOSTTYPE" -a "${skip_sgi+set}" != set -a "${NOCALLS+set}" != set ]; then
153                XUSERFILESEARCHPATH="$HOME/.desktop-$host/%N:$HOME/.desktop-$host/0.0/%N:$XUSERFILESEARCHPATH"
154        fi
155
156        export XUSERFILESEARCHPATH
157
158
159        if [ sun4 = "$HOSTTYPE" ]; then
160                if [ "${XFILESEARCHPATH+set}" != set ]; then
161                        XFILESEARCHPATH="/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%S"
162                else
163                        XFILESEARCHPATH="$XFILESEARCHPATH:/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%S"
164                fi
165                export XFILESEARCHPATH
166        fi
167fi
168       
169
170# *******************  BASH SETUP   *******************
171
172# Set up standard bash shell initializations
173
174set -o noclobber                # Don't overwrite files with redirection
175
176if [ "${PS1+set}" = set ]; then
177        if [ sgi = "$HOSTTYPE" -a -t 0 ]; then
178                # Have no better way to do this at the moment.
179                stty sane intr ^C
180        fi
181        PS1="athena$ "
182        HISTSIZE=20
183        CDPATH=~
184fi
185
186# Fix coredumpsize limit in case it was reset
187ulimit -c $COREDUMPSIZE_LIMIT
188
189#   alias for re-establishing authentication
190renew () { kinit $USER && fsid -a && zctl load /dev/null ; }
191
192#   alias for a convenient way to change terminal type
193term () { set -f; unset TERMCAP; eval "$( tset -s -I -Q "$@" )"; set +f; }
194
195#   aliases dealing with mail
196alias mail=Mail
197Mail () { more /usr/prototype_user/README.mail ; }
198
199#   aliases dealing with x window system
200xresize () { set -f; eval "$( resize -u )"; set +f ; }
201
202if [ "${XSESSION+set}" = set ]; then
203        if [ -z "$XSESSION" ]; then
204                logout () { end_session && exit; }              # logout for X
205        else
206                logout () { kill -HUP $XSESSION && exit; }      # logout for X
207        fi
208fi
209
210#   aliases dealing with adding locker programs
211
212add_flags=
213add () { eval "$( /bin/athena/attach -Padd -b $add_flags "$@" )" ; }
214
215alias setup='echo "setup is not supported in bash yet"'
216
217
218# All of the bash initializing commands above can be overridden by using
219# "unset" or "unalias" commands (or by changing things using "set" or
220# "alias" again) in your ~/.bashrc.mine file, which is sourced here.
221# ~/.bashsrc.mine is not sourced if the xlogin "Ignore your customizations"
222# option was selected to begin the session.
223
224if [ "${NOCALLS+set}" != set -a -r ~/.bashrc.mine ]; then
225        . ~/.bashrc.mine
226fi
Note: See TracBrowser for help on using the repository browser.