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

Revision 25954, 6.6 KB checked in by jdreed, 12 years ago (diff)
* Don't source the bourne shell clusterinfo in tcsh * Mark 10.0.32-0debathena2 as released
  • 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# Determine if we're in an sftp or scp session, and if so, be quiet
11set SILENT=no
12if ($?command) then
13  switch ("${command:q}")
14    case '*/usr/lib/openssh/sftp-server':
15      set SILENT=yes
16      breaksw
17    case 'scp *':
18      set SILENT=yes
19      breaksw
20  endsw
21endif
22
23# *******************   ENVIRONMENT SETUP   *******************
24
25# Compatibility with older versions of Athena tcsh
26set autolist=""
27if ($?tcsh) then
28  bindkey "^W" backward-delete-word
29  bindkey "^Z" complete-word
30  bindkey " " magic-space
31
32endif
33
34# Set host type and hostname variables.
35if (! $?ATHENA_HOSTTYPE) setenv ATHENA_HOSTTYPE "`/bin/machtype`"
36if (! $?HOST) setenv HOST "`hostname`"
37setenv HOSTTYPE "$ATHENA_HOSTTYPE"
38set hosttype=$HOSTTYPE
39set host=$HOST
40
41# Set up standard system/user environment configuration (including setup of
42# environment variables, attachment of lockers, and additions to search path)
43
44if (! $?ENV_SET) then
45
46  setenv ENV_SET                                # Avoid unnecessary repeat
47
48  # Ensure user's homedir is attached, for legacy things
49  # that care about attachtab
50  # Only attach if running as an Athena user, not e.g. using sudo.
51  if ( $?DEBATHENA_HOME_TYPE ) then
52    if ( $DEBATHENA_HOME_TYPE == afs ) then
53      if ( $?ATHENA_USER ) then
54        /bin/attach -h -q "$ATHENA_USER"
55      else
56        /bin/attach -h -q "$USER"
57      endif
58    endif
59  endif
60
61  if (-r ~/.generation) then
62    setenv ATHENA_DOTFILE_GENERATION `cat ~/.generation`
63  else
64    setenv ATHENA_DOTFILE_GENERATION 0
65  endif
66
67  limit coredumpsize 0                  # Don't allow coredumps
68  setenv MORE -s                        # Default "more" behavior
69                                        # we are now down to -s
70                                        # because -d is wrong.
71  setenv EDITOR emacs                   # Set default editor
72  setenv MM_CHARSET iso-8859-1
73
74  setenv EMAIL "$USER@mit.edu"          # Set default email address
75
76  setenv ATHENA_SYS `/bin/machtype -S`
77  if ( $ATHENA_SYS == "" ) then
78    setenv ATHENA_SYS @sys
79  endif
80  setenv ATHENA_SYS_COMPAT `/bin/machtype -C`
81
82  set bindir=arch/${ATHENA_SYS}/bin
83
84  if ( ! $?PRINTER && -e /var/run/athena-clusterinfo.csh ) then
85    # Backticks will get us a subshell to avoid any other variables
86    setenv PRINTER `setenv LPR '' && source /var/run/athena-clusterinfo.csh && echo $LPR`
87    if ( $PRINTER == "" ) unsetenv PRINTER
88  endif
89
90  # Reset the "home" and HOME variables to correspond to the actual
91  # location of the user's home directory.  This will avoid having
92  # long pathnames being printed when /mit/<user> is a symlink to a
93  # path within AFS.
94
95  set x=`(cd && /bin/pwd)`
96  if ("$x" != "") then
97    set home=$x
98    if ("$x" == "`/bin/pwd`") then
99      set cwd=$x
100    endif
101  endif
102  unset x
103
104  # NOTE:
105  # The use of the "extend", "sextend", and "textend" aliases in
106  # ~/.environment is no longer supported.  Consult the Athena
107  # documentation on Dotfiles for supported dotfile operations
108
109  # Run user environment customizations identified in your
110  # ~/.environment file.  This is the place to include your own
111  # environment variables, attach commands, and other system wide
112  # setup commands.  You can also cancel default behaviors listed
113  # above with "unsetenv" or "setenv".  ~/.environment is not sourced
114  # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your
115  # customizations" option when you logged in).
116
117  if ((! $?NOCALLS) && (-r ~/.environment)) then
118    if ( $SILENT == "yes" ) then
119      source ~/.environment >&/dev/null
120    else
121      source ~/.environment
122    endif
123  endif
124
125  # NOTE:
126  # .path files are no longer supported, consult Athena documentation
127  # for the correct way to specify your PATH
128 
129  # Standard Athena path additions.
130  set path=(`/usr/bin/athdir $HOME` $path .)
131
132endif
133
134# Set appropriate bin directory variable for this platform
135# (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.;  this will
136# be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin):
137set bindir=arch/${ATHENA_SYS}/bin
138
139# *******************  C SHELL SETUP   *******************
140
141# Set up standard C shell initializations
142
143set noclobber                   # Don't overwrite files with redirection
144
145if ($?prompt) then              # For interactive shells only (i.e., NOT rsh):
146  set interactive               #   Provide shell variable for compatability
147endif
148
149# Set up standard C shell aliases
150
151if ($?XSESSION) then
152  if ( -x /usr/bin/gnome-session-quit ) then
153    alias logout        'exit && /usr/lib/init/check-for-reboot && gnome-session-quit --no-prompt'      # logout for X
154  else
155    alias logout        'exit && /usr/lib/init/check-for-reboot && gnome-session-save --kill --silent'  # logout for X
156  endif
157endif
158
159#   aliases dealing with subjects
160alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )'
161alias setup_tty '( setenv SUBJECT \!* ; $SHELL )'
162if ($?XSESSION) then
163  alias setup setup_X
164else
165  alias setup setup_tty
166endif
167alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove ; unsetenv SUBJECT'
168
169# If this is a subject window, run the env_setup script
170if (($?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
179if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) then
180  if ( $SILENT == "yes" ) then
181    source ~/.cshrc.mine >&/dev/null
182  else
183    source ~/.cshrc.mine
184  endif
185endif
186
187if (! $?skip_sanity_checks) then
188  set missing=0
189  echo $path | /usr/bin/tr ' ' '\n' | /bin/grep -Fqx /bin
190  if ( $? != 0 ) then
191    set missing=1
192  endif
193  echo $path | /usr/bin/tr ' ' '\n' | /bin/grep -Fqx /usr/bin
194  if ( $? != 0 ) then
195    set missing=1
196  endif
197  if ( $missing == 1 ) then
198    set text="You appear to have incorrectly modified your PATH variable in your dotiles,\nand as such have deleted /bin and/or /usr/bin from your PATH, which\nwill likely cause this login session to fail.  Please correct this problem.\nThis warning can be disabled with 'set skip_sanity_checks=t' in ~/.cshrc.mine."
199    echo "$text" > /dev/stderr
200    if ( $?DISPLAY) then
201      /usr/bin/zenity --warning --text="$text"
202    endif
203  endif
204  if ( $?LD_ASSUME_KERNEL ) then
205    unsetenv LD_ASSUME_KERNEL
206    set text="In your dotfiles, you set LD_ASSUME_KERNEL.  This generally causes undesirable behavior.\nIt has been unset for you.\nIf you really wanted it set, you can add 'set skip_sanity_checks=t' to your ~/.cshrc.mine."
207    echo "$text" > /dev/stderr
208    if ( $?DISPLAY) then
209      /usr/bin/zenity --warning --text="$text"
210    endif
211  endif     
212endif
Note: See TracBrowser for help on using the repository browser.