1 | # Global cshrc file |
---|
2 | # |
---|
3 | # $Id: cshrc,v 1.12 2007-08-22 18:12:33 ghudson Exp $ |
---|
4 | |
---|
5 | # This file is sourced by default user file ~/.cshrc |
---|
6 | |
---|
7 | |
---|
8 | set initdir=/usr/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 | endif |
---|
20 | |
---|
21 | # Set host type and hostname variables. |
---|
22 | if (! $?ATHENA_HOSTTYPE) setenv ATHENA_HOSTTYPE "`/bin/machtype`" |
---|
23 | if (! $?HOST) setenv HOST "`hostname`" |
---|
24 | setenv HOSTTYPE "$ATHENA_HOSTTYPE" |
---|
25 | set hosttype=$HOSTTYPE |
---|
26 | set host=$HOST |
---|
27 | |
---|
28 | # add alias for attaching lockers |
---|
29 | alias add 'eval `/bin/attach -Padd \!:*`' |
---|
30 | |
---|
31 | # Set up standard system/user environment configuration (including setup of |
---|
32 | # environment variables, attachment of lockers, and additions to search path) |
---|
33 | |
---|
34 | if (! $?ENV_SET) then |
---|
35 | |
---|
36 | setenv ENV_SET # Avoid unnecessary repeat |
---|
37 | |
---|
38 | if (-r ~/.generation) then |
---|
39 | setenv ATHENA_DOTFILE_GENERATION `cat ~/.generation` |
---|
40 | else |
---|
41 | setenv ATHENA_DOTFILE_GENERATION 0 |
---|
42 | endif |
---|
43 | |
---|
44 | umask 077 # Strictly protect files |
---|
45 | # (does not apply in AFS) |
---|
46 | limit coredumpsize 0 # Don't allow coredumps |
---|
47 | setenv MORE -s # Default "more" behavior |
---|
48 | # we are now down to -s |
---|
49 | # because -d is wrong. |
---|
50 | setenv EDITOR emacs # Set default editor |
---|
51 | setenv VISUAL emacs # Set default screen editor |
---|
52 | setenv MM_CHARSET iso-8859-1 |
---|
53 | |
---|
54 | # Set double-sided printing for sufficiently recent users. |
---|
55 | if ( $ATHENA_DOTFILE_GENERATION >= 1 ) then |
---|
56 | setenv LPROPT -Zduplex |
---|
57 | endif |
---|
58 | |
---|
59 | setenv ATHENA_SYS `/bin/machtype -S` |
---|
60 | if ( $ATHENA_SYS == "" ) then |
---|
61 | setenv ATHENA_SYS @sys |
---|
62 | endif |
---|
63 | setenv ATHENA_SYS_COMPAT `/bin/machtype -C` |
---|
64 | |
---|
65 | set bindir=arch/${ATHENA_SYS}/bin |
---|
66 | |
---|
67 | if ( ! $?PRINTER && -e /var/run/athena-clusterinfo.csh ) then |
---|
68 | setenv PRINTER `awk '/LPR/ { print $3 }' /var/run/athena-clusterinfo.csh` |
---|
69 | if ( $PRINTER == "" ) unsetenv PRINTER |
---|
70 | endif |
---|
71 | |
---|
72 | # Reset the "home" and HOME variables to correspond to the actual |
---|
73 | # location of the user's home directory. This will avoid having |
---|
74 | # long pathnames being printed when /mit/<user> is a symlink to a |
---|
75 | # path within AFS. |
---|
76 | |
---|
77 | set x=`(cd && /bin/pwd)` |
---|
78 | if ("$x" != "") then |
---|
79 | set home=$x |
---|
80 | if ("$x" == "`/bin/pwd`") then |
---|
81 | set cwd=$x |
---|
82 | endif |
---|
83 | endif |
---|
84 | unset x |
---|
85 | |
---|
86 | # This "extend" alias and friends have been left in for backwards |
---|
87 | # compatibility with old .environment files, just in case. The new |
---|
88 | # add alias does not use them. |
---|
89 | alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
90 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
91 | if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\ |
---|
92 | unset extendyes' |
---|
93 | alias sextend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
94 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
95 | if ($?extendyes) set \!:1=(${\!:1} \!:2) && \\ |
---|
96 | unset extendyes' |
---|
97 | alias textend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
98 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
99 | if ($?extendyes) set \!:1=${\!:1}:\!:2 && \\ |
---|
100 | unset extendyes' |
---|
101 | |
---|
102 | # Run user environment customizations identified in your |
---|
103 | # ~/.environment file. This is the place to include your own |
---|
104 | # environment variables, attach commands, and other system wide |
---|
105 | # setup commands. You can also cancel default behaviors listed |
---|
106 | # above with "unsetenv" or "setenv". ~/.environment is not sourced |
---|
107 | # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your |
---|
108 | # customizations" option when you logged in). |
---|
109 | |
---|
110 | if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment |
---|
111 | |
---|
112 | unalias extend sextend textend |
---|
113 | |
---|
114 | if ((! $?NOCALLS) && (-r ~/.path)) then |
---|
115 | # Support .path files for compatibility. |
---|
116 | set athena_path=($path) |
---|
117 | source ~/.path |
---|
118 | else |
---|
119 | # Standard Athena path additions. |
---|
120 | set path=(`/usr/bin/athdir $HOME` $path .) |
---|
121 | endif |
---|
122 | |
---|
123 | endif |
---|
124 | |
---|
125 | # Set appropriate bin directory variable for this platform |
---|
126 | # (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.; this will |
---|
127 | # be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin): |
---|
128 | set bindir=arch/${ATHENA_SYS}/bin |
---|
129 | |
---|
130 | # ******************* C SHELL SETUP ******************* |
---|
131 | |
---|
132 | # Set up standard C shell initializations |
---|
133 | |
---|
134 | set noclobber # Don't overwrite files with redirection |
---|
135 | |
---|
136 | if ($?prompt) then # For interactive shells only (i.e., NOT rsh): |
---|
137 | # Set prompt. |
---|
138 | set promptchars="%#" |
---|
139 | set prompt = "athena%# " |
---|
140 | set cdpath = (~) |
---|
141 | set interactive # Provide shell variable for compatability |
---|
142 | endif |
---|
143 | |
---|
144 | # Set up standard C shell aliases |
---|
145 | |
---|
146 | # alias for re-establishing authentication |
---|
147 | alias renew 'kinit -54 $USER && fsid -a && zctl load /dev/null' |
---|
148 | |
---|
149 | # alias for a convenient way to change terminal type |
---|
150 | alias term 'set noglob; unsetenv TERMCAP; eval `tset -s -I -Q \!*`' |
---|
151 | |
---|
152 | # aliases dealing with x window system |
---|
153 | alias xresize 'set noglob; eval `resize -c` || unset noglob' |
---|
154 | |
---|
155 | if ($?XSESSION) then |
---|
156 | alias logout 'exit && gnome-session-save --kill --silent' # logout for X |
---|
157 | endif |
---|
158 | |
---|
159 | # aliases dealing with subjects |
---|
160 | alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )' |
---|
161 | alias setup_tty '( setenv SUBJECT \!* ; $SHELL )' |
---|
162 | if ($?XSESSION) then |
---|
163 | alias setup setup_X |
---|
164 | else |
---|
165 | alias setup setup_tty |
---|
166 | endif |
---|
167 | alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove' |
---|
168 | |
---|
169 | # If this is a subject window, run the env_setup script |
---|
170 | if (($?SUBJECT) && (-r $initdir/env_setup)) source $initdir/env_setup |
---|
171 | |
---|
172 | |
---|
173 | # All of the C shell initializing commands above can be overridden by |
---|
174 | # using "unset" or "unalias" commands (or by changing things using |
---|
175 | # "set" or "alias" again) in your ~/.cshrc.mine file, which is sourced |
---|
176 | # here. ~/.cshrc.mine is not sourced if the xlogin "Ignore your |
---|
177 | # customizations" option was selected to begin the session. |
---|
178 | |
---|
179 | if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) source ~/.cshrc.mine |
---|