1 | # Global cshrc file |
---|
2 | # |
---|
3 | # $Id: cshrc,v 1.4 2003-04-04 17:30:30 ghudson Exp $ |
---|
4 | |
---|
5 | # This file is sourced by default user file ~/.cshrc |
---|
6 | |
---|
7 | |
---|
8 | set initdir=/usr/athena/lib/init |
---|
9 | |
---|
10 | # ******************* ENVIRONMENT SETUP ******************* |
---|
11 | |
---|
12 | # Compatibility with older versions of Athena tcsh |
---|
13 | set autolist="" |
---|
14 | if ($?tcsh) then |
---|
15 | bindkey "^W" backward-delete-word |
---|
16 | bindkey "^Z" complete-word |
---|
17 | bindkey " " magic-space |
---|
18 | |
---|
19 | if ($tcsh:r:e > 7 || $tcsh:r:r > 6) then |
---|
20 | alias bind 'echo The \"bind\" command is no longer supported in tcsh 6.08. Use the; echo \"bindkey\" command instead. See the tcsh man page for more information.; ( echo \!* > /dev/null )' |
---|
21 | endif |
---|
22 | endif |
---|
23 | |
---|
24 | # Set up standard system/user environment configuration (including setup of |
---|
25 | # environment variables, attachment of lockers, and setting of search path) |
---|
26 | |
---|
27 | if (! $?ENV_SET) then |
---|
28 | |
---|
29 | setenv ENV_SET # Avoid unnecessary repeat |
---|
30 | setenv HOSTTYPE "`/bin/athena/machtype`" |
---|
31 | setenv HOST "`hostname`" |
---|
32 | set hosttype=$HOSTTYPE |
---|
33 | set host=$HOST |
---|
34 | |
---|
35 | umask 077 # Strictly protect files |
---|
36 | # (does not apply in AFS) |
---|
37 | limit coredumpsize 0 # Don't allow coredumps |
---|
38 | setenv MORE -s # Default "more" behavior |
---|
39 | # we are now down to -s |
---|
40 | # because -d is wrong. |
---|
41 | setenv EDITOR emacs # Set default editor |
---|
42 | setenv VISUAL emacs # Set default screen editor |
---|
43 | setenv MM_CHARSET iso-8859-1 |
---|
44 | |
---|
45 | # Set standard Athena path variables. Actual $path (and thus $PATH) |
---|
46 | # are set later, after ~/.environment is sourced. |
---|
47 | |
---|
48 | switch ("$HOSTTYPE") |
---|
49 | case sun4: |
---|
50 | set athena_path=( /srvd/patch /usr/athena/bin /usr/athena/etc /bin/athena \ |
---|
51 | /usr/openwin/bin /usr/openwin/demo /usr/bin \ |
---|
52 | /usr/ccs/bin /usr/sbin /sbin /usr/ucb ) |
---|
53 | set athena_manpath=/usr/athena/man:/usr/openwin/man:/usr/dt/man:/usr/man |
---|
54 | breaksw |
---|
55 | case linux: |
---|
56 | set athena_path=( /usr/athena/bin /usr/athena/etc /bin/athena /usr/bin \ |
---|
57 | /bin /usr/X11R6/bin /usr/sbin /sbin ) |
---|
58 | set athena_manpath=/usr/athena/man:/usr/share/man:/usr/X11R6/man |
---|
59 | breaksw |
---|
60 | default: |
---|
61 | echo "Standard dotfiles do not support system type $HOSTTYPE." |
---|
62 | breaksw |
---|
63 | endsw |
---|
64 | |
---|
65 | setenv MANPATH "$athena_manpath" |
---|
66 | |
---|
67 | # Set other miscellaneous OS-specific environment variables |
---|
68 | switch ("$HOSTTYPE") |
---|
69 | case sun4: |
---|
70 | setenv LD_LIBRARY_PATH /usr/openwin/lib |
---|
71 | setenv OPENWINHOME /usr/openwin |
---|
72 | breaksw |
---|
73 | case linux: |
---|
74 | # This is to ensure that native programs use the Athena gconf, ORBit, |
---|
75 | # bonobo-activation, etc. libraries rather than the native ones. |
---|
76 | # GNOME programs outside of /usr/athena/bin may not function properly |
---|
77 | # if it is not set. |
---|
78 | setenv LD_LIBRARY_PATH /usr/athena/lib |
---|
79 | breaksw |
---|
80 | endsw |
---|
81 | |
---|
82 | setenv ATHENA_SYS `/bin/athena/machtype -S` |
---|
83 | if ( $ATHENA_SYS == "" ) then |
---|
84 | setenv ATHENA_SYS @sys |
---|
85 | endif |
---|
86 | setenv ATHENA_SYS_COMPAT `/bin/athena/machtype -C` |
---|
87 | |
---|
88 | set bindir=arch/${ATHENA_SYS}/bin |
---|
89 | |
---|
90 | if ( ! $?PRINTER && -e /var/athena/clusterinfo ) then |
---|
91 | setenv PRINTER `awk '/LPR/ { print $3 }' /var/athena/clusterinfo` |
---|
92 | if ( $PRINTER == "" ) unsetenv PRINTER |
---|
93 | endif |
---|
94 | |
---|
95 | # Reset the "home" and HOME variables to correspond to the actual |
---|
96 | # location of the user's home directory. This will avoid having |
---|
97 | # long pathnames being printed when /mit/<user> is a symlink to a |
---|
98 | # path within AFS. |
---|
99 | # |
---|
100 | # This code has been optimized to run as quickly as possible. Since |
---|
101 | # it is being invoked only at the beginning of the session, and |
---|
102 | # prior to the inclusion of any of the user's other dotfiles, we can |
---|
103 | # assume that the current directory is the user's home directory. |
---|
104 | # Also, to avoid having the shell re-evaluate the current contents |
---|
105 | # of the directory, we help it by resetting its "cwd" variable. We |
---|
106 | # do error checking just in case the path somehow disappears. |
---|
107 | |
---|
108 | set x=`/bin/pwd` |
---|
109 | if ("$x" != "") then |
---|
110 | set home=$x cwd=$x |
---|
111 | endif |
---|
112 | unset x |
---|
113 | |
---|
114 | # Special version of add alias that will work in your ~/.environment |
---|
115 | # file. This is replaced further down with the version that works |
---|
116 | # when you are logged in. |
---|
117 | |
---|
118 | # This "extend" alias and friends have been left in for backwards |
---|
119 | # compatibility with old .environment files, just in case. The new |
---|
120 | # add alias does not use them. |
---|
121 | alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
122 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
123 | if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\ |
---|
124 | unset extendyes' |
---|
125 | alias sextend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
126 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
127 | if ($?extendyes) set \!:1=(${\!:1} \!:2) && \\ |
---|
128 | unset extendyes' |
---|
129 | alias textend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
130 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
131 | if ($?extendyes) set \!:1=${\!:1}:\!:2 && \\ |
---|
132 | unset extendyes' |
---|
133 | |
---|
134 | alias add 'eval `/bin/athena/attach -Padd -P "$athena_path" \!:*`' |
---|
135 | |
---|
136 | # Run user environment customizations identified in your |
---|
137 | # ~/.environment file. This is the place to include your own |
---|
138 | # environment variables, attach commands, and other system wide |
---|
139 | # setup commands. You can also cancel default behaviors listed |
---|
140 | # above with "unsetenv" or "setenv". ~/.environment is not sourced |
---|
141 | # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your |
---|
142 | # customizations" option when you logged in). |
---|
143 | |
---|
144 | if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment |
---|
145 | |
---|
146 | # remove temporary version of add |
---|
147 | unalias extend sextend textend add |
---|
148 | alias add 'echo Use add in your ~/.environment, not your ~/.path.' |
---|
149 | |
---|
150 | # Reset athena_manpath in case .path uses it (.path should just use |
---|
151 | # $MANPATH, but using $athena_manpath has worked historically). |
---|
152 | set athena_manpath=$MANPATH |
---|
153 | |
---|
154 | # Set up default search path, if not yet set. Use your ~/.path file |
---|
155 | # to provide an alternative path -- this file should be of the form |
---|
156 | # "set path=...", and can refer to the shell variable $athena_path, |
---|
157 | # defined above. The ~/.path file should list a complete path, since |
---|
158 | # the path identified there will be used INSTEAD of the default |
---|
159 | # path, not appended. ~/.path is not sourced if the xlogin "Ignore |
---|
160 | # your customizations" option was selected to begin the session. |
---|
161 | |
---|
162 | if ((! $?NOCALLS) && (-r ~/.path)) then |
---|
163 | # User-specified path |
---|
164 | source ~/.path |
---|
165 | else |
---|
166 | # Standard Athena path |
---|
167 | set path=(`/usr/athena/bin/athdir $HOME` $athena_path .) |
---|
168 | endif |
---|
169 | |
---|
170 | # Make sure applications can properly find their appdefs, etc. |
---|
171 | |
---|
172 | if (! $?XUSERFILESEARCHPATH) then |
---|
173 | setenv XUSERFILESEARCHPATH "/usr/athena/lib/X11/app-defaults/%N" |
---|
174 | else |
---|
175 | setenv XUSERFILESEARCHPATH "${XUSERFILESEARCHPATH}:/usr/athena/lib/X11/app-defaults/%N" |
---|
176 | endif |
---|
177 | endif |
---|
178 | |
---|
179 | # Set appropriate bin directory variable for this platform |
---|
180 | # (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.; this will |
---|
181 | # be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin): |
---|
182 | set bindir=arch/${ATHENA_SYS}/bin |
---|
183 | |
---|
184 | # ******************* C SHELL SETUP ******************* |
---|
185 | |
---|
186 | # Set up standard C shell initializations |
---|
187 | |
---|
188 | set noclobber # Don't overwrite files with redirection |
---|
189 | |
---|
190 | if ($?prompt) then # For interactive shells only (i.e., NOT rsh): |
---|
191 | # Set prompt. |
---|
192 | set promptchars="%#" |
---|
193 | if ($home =~ /var/athena/tmphomedir/*) then |
---|
194 | set prompt = "athena (temporary homedir)%# " |
---|
195 | else |
---|
196 | set prompt = "athena%# " |
---|
197 | endif |
---|
198 | |
---|
199 | set history = 20 # Number of commands saved as history |
---|
200 | set cdpath = (~) # Path to search for directory changes |
---|
201 | set interactive # Provide shell variable for compatability |
---|
202 | set nostat = (/afs/) # Don't stat when completing in /afs |
---|
203 | endif |
---|
204 | |
---|
205 | set hosttype=$HOSTTYPE |
---|
206 | set host=$HOST |
---|
207 | |
---|
208 | # Set up standard C shell aliases |
---|
209 | |
---|
210 | # alias for re-establishing authentication |
---|
211 | alias renew 'kinit $USER && fsid -a && zctl load /dev/null' |
---|
212 | |
---|
213 | # alias for a convenient way to change terminal type |
---|
214 | alias term 'set noglob; unsetenv TERMCAP; eval `tset -s -I -Q \!*`' |
---|
215 | |
---|
216 | # aliases dealing with x window system |
---|
217 | alias xresize 'set noglob; eval `resize -c` || unset noglob' |
---|
218 | |
---|
219 | if ($?XSESSION) then |
---|
220 | if ("$XSESSION" == "") then |
---|
221 | alias logout 'exit && end_session' # logout for X |
---|
222 | else |
---|
223 | alias logout 'exit && kill -HUP $XSESSION' # logout for X |
---|
224 | endif |
---|
225 | endif |
---|
226 | |
---|
227 | # aliases dealing with adding locker programs |
---|
228 | # extend remains for other software; add no longer uses the extend alias |
---|
229 | alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
230 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
231 | if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\ |
---|
232 | unset extendyes' |
---|
233 | |
---|
234 | set add_flags |
---|
235 | alias add 'eval `/bin/athena/attach -Padd $add_flags \!:*`' |
---|
236 | |
---|
237 | # aliases dealing with subjects |
---|
238 | alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )' |
---|
239 | alias setup_tty '( setenv SUBJECT \!* ; $SHELL )' |
---|
240 | if ($?XSESSION) then |
---|
241 | alias setup setup_X |
---|
242 | else |
---|
243 | alias setup setup_tty |
---|
244 | endif |
---|
245 | alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove' |
---|
246 | |
---|
247 | # If this is a subject window, run the env_setup script |
---|
248 | if (($?SUBJECT) && (-r $initdir/env_setup)) source $initdir/env_setup |
---|
249 | |
---|
250 | |
---|
251 | # All of the C shell initializing commands above can be overridden by |
---|
252 | # using "unset" or "unalias" commands (or by changing things using |
---|
253 | # "set" or "alias" again) in your ~/.cshrc.mine file, which is sourced |
---|
254 | # here. ~/.cshrc.mine is not sourced if the xlogin "Ignore your |
---|
255 | # customizations" option was selected to begin the session. |
---|
256 | |
---|
257 | if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) source ~/.cshrc.mine |
---|