source: trunk/debathena/debathena/dotfiles/cshrc @ 23438

Revision 23438, 5.8 KB checked in by tabbott, 16 years ago (diff)
In dotfiles: * Set $EMAIL in the system dotfiles.
  • Property svn:executable set to *
Line 
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
8set initdir=/usr/lib/init
9
10# *******************   ENVIRONMENT SETUP   *******************
11
12# Compatibility with older versions of Athena tcsh
13set autolist=""
14if ($?tcsh) then
15  bindkey "^W" backward-delete-word
16  bindkey "^Z" complete-word
17  bindkey " " magic-space
18
19endif
20
21# Set host type and hostname variables.
22if (! $?ATHENA_HOSTTYPE) setenv ATHENA_HOSTTYPE "`/bin/machtype`"
23if (! $?HOST) setenv HOST "`hostname`"
24setenv HOSTTYPE "$ATHENA_HOSTTYPE"
25set hosttype=$HOSTTYPE
26set host=$HOST
27
28# add alias for attaching lockers
29alias 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
34if (! $?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  setenv EMAIL "$USER@mit.edu"          # Set default email address
55
56  # Set double-sided printing for sufficiently recent users.
57  if ( $ATHENA_DOTFILE_GENERATION >= 1 ) then
58    setenv LPROPT -Zduplex
59  endif
60
61  setenv ATHENA_SYS `/bin/machtype -S`
62  if ( $ATHENA_SYS == "" ) then
63    setenv ATHENA_SYS @sys
64  endif
65  setenv ATHENA_SYS_COMPAT `/bin/machtype -C`
66
67  set bindir=arch/${ATHENA_SYS}/bin
68
69  if ( ! $?PRINTER && -e /var/run/athena-clusterinfo.csh ) then
70    setenv PRINTER `awk '/LPR/ { print $3 }' /var/run/athena-clusterinfo.csh`
71    if ( $PRINTER == "" ) unsetenv PRINTER
72  endif
73
74  # Reset the "home" and HOME variables to correspond to the actual
75  # location of the user's home directory.  This will avoid having
76  # long pathnames being printed when /mit/<user> is a symlink to a
77  # path within AFS.
78
79  set x=`(cd && /bin/pwd)`
80  if ("$x" != "") then
81    set home=$x
82    if ("$x" == "`/bin/pwd`") then
83      set cwd=$x
84    endif
85  endif
86  unset x
87
88  # This "extend" alias and friends have been left in for backwards
89  # compatibility with old .environment files, just in case. The new
90  # add alias does not use them.
91  alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
92  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
93  if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\
94  unset extendyes'
95  alias sextend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
96  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
97  if ($?extendyes) set \!:1=(${\!:1} \!:2) && \\
98  unset extendyes'
99  alias textend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
100  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
101  if ($?extendyes) set \!:1=${\!:1}:\!:2 && \\
102  unset extendyes'
103
104  # Run user environment customizations identified in your
105  # ~/.environment file.  This is the place to include your own
106  # environment variables, attach commands, and other system wide
107  # setup commands.  You can also cancel default behaviors listed
108  # above with "unsetenv" or "setenv".  ~/.environment is not sourced
109  # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your
110  # customizations" option when you logged in).
111
112  if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment
113
114  unalias extend sextend textend
115
116  if ((! $?NOCALLS) && (-r ~/.path)) then
117    # Support .path files for compatibility.
118    set athena_path=($path)
119    source ~/.path
120  else
121    # Standard Athena path additions.
122    set path=(`/usr/bin/athdir $HOME` $path .)
123  endif
124
125endif
126
127# Set appropriate bin directory variable for this platform
128# (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.;  this will
129# be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin):
130set bindir=arch/${ATHENA_SYS}/bin
131
132# *******************  C SHELL SETUP   *******************
133
134# Set up standard C shell initializations
135
136set noclobber                   # Don't overwrite files with redirection
137
138if ($?prompt) then              # For interactive shells only (i.e., NOT rsh):
139  # Set prompt.
140  set promptchars="%#"
141  set prompt = "athena%# "
142  set cdpath = (~)
143  set interactive               #   Provide shell variable for compatability
144endif
145
146# Set up standard C shell aliases
147
148#   alias for re-establishing authentication
149alias renew 'kinit -54 $USER && fsid -a && zctl load /dev/null'
150
151#   alias for a convenient way to change terminal type
152alias term 'set noglob; unsetenv TERMCAP; eval `tset -s -I -Q \!*`'
153
154#   aliases dealing with x window system
155alias xresize 'set noglob; eval `resize -c` || unset noglob'
156
157if ($?XSESSION) then
158  alias logout  'exit && gnome-session-save --kill --silent'    # logout for X
159endif
160
161#   aliases dealing with subjects
162alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )'
163alias setup_tty '( setenv SUBJECT \!* ; $SHELL )'
164if ($?XSESSION) then
165  alias setup setup_X
166else
167  alias setup setup_tty
168endif
169alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove'
170
171# If this is a subject window, run the env_setup script
172if (($?SUBJECT) && (-r $initdir/env_setup)) source $initdir/env_setup
173
174
175# All of the C shell initializing commands above can be overridden by
176# using "unset" or "unalias" commands (or by changing things using
177# "set" or "alias" again) in your ~/.cshrc.mine file, which is sourced
178# here.  ~/.cshrc.mine is not sourced if the xlogin "Ignore your
179# customizations" option was selected to begin the session.
180
181if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) source ~/.cshrc.mine
Note: See TracBrowser for help on using the repository browser.