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

Revision 24792, 4.7 KB checked in by geofft, 14 years ago (diff)
In dotfiles: * Bump upstream version number because previous changes (and this change) modified things outside debian/. * Drop 0debathena business from the Debian version number because Debathena has been upstream for a while now. * Only attach $USER if $ATHENA_USER is set, to avoid an error message with "sudo bash". Patch from Thomas Coles. Signed-off-by: Thomas Coles <tcoles@mit.edu> [geofft: also switch to attaching $ATHENA_USER instead of $USER] Signed-off-by: Geoffrey Thomas <geofft@mit.edu>
  • 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# Set up standard system/user environment configuration (including setup of
29# environment variables, attachment of lockers, and additions to search path)
30
31if (! $?ENV_SET) then
32
33  setenv ENV_SET                                # Avoid unnecessary repeat
34
35  # Ensure user's homedir is attached, for legacy things
36  # that care about attachtab
37  # Only attach if running as an Athena user, not e.g. using sudo.
38  if ( $?ATHENA_USER ) then
39    /bin/attach -h -q "$ATHENA_USER"
40  endif
41
42  if (-r ~/.generation) then
43    setenv ATHENA_DOTFILE_GENERATION `cat ~/.generation`
44  else
45    setenv ATHENA_DOTFILE_GENERATION 0
46  endif
47
48  limit coredumpsize 0                  # Don't allow coredumps
49  setenv MORE -s                        # Default "more" behavior
50                                        # we are now down to -s
51                                        # because -d is wrong.
52  setenv EDITOR emacs                   # Set default editor
53  setenv MM_CHARSET iso-8859-1
54
55  setenv EMAIL "$USER@mit.edu"          # Set default email address
56
57  # Set double-sided printing for sufficiently recent users.
58  if ( $ATHENA_DOTFILE_GENERATION >= 1 ) then
59    setenv LPROPT -Zduplex
60  endif
61
62  setenv ATHENA_SYS `/bin/machtype -S`
63  if ( $ATHENA_SYS == "" ) then
64    setenv ATHENA_SYS @sys
65  endif
66  setenv ATHENA_SYS_COMPAT `/bin/machtype -C`
67
68  set bindir=arch/${ATHENA_SYS}/bin
69
70  if ( ! $?PRINTER && -e /var/run/athena-clusterinfo.csh ) then
71    setenv PRINTER `awk '/LPR/ { print $3 }' /var/run/athena-clusterinfo.csh`
72    if ( $PRINTER == "" ) unsetenv PRINTER
73  endif
74
75  # Reset the "home" and HOME variables to correspond to the actual
76  # location of the user's home directory.  This will avoid having
77  # long pathnames being printed when /mit/<user> is a symlink to a
78  # path within AFS.
79
80  set x=`(cd && /bin/pwd)`
81  if ("$x" != "") then
82    set home=$x
83    if ("$x" == "`/bin/pwd`") then
84      set cwd=$x
85    endif
86  endif
87  unset x
88
89  # NOTE:
90  # The use of the "extend", "sextend", and "textend" aliases in
91  # ~/.environment is no longer supported.  Consult the Athena
92  # documentation on Dotfiles for supported dotfile operations
93
94  # Run user environment customizations identified in your
95  # ~/.environment file.  This is the place to include your own
96  # environment variables, attach commands, and other system wide
97  # setup commands.  You can also cancel default behaviors listed
98  # above with "unsetenv" or "setenv".  ~/.environment is not sourced
99  # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your
100  # customizations" option when you logged in).
101
102  if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment
103
104  # NOTE:
105  # .path files are no longer supported, consult Athena documentation
106  # for the correct way to specify your PATH
107 
108  # Standard Athena path additions.
109  set path=(`/usr/bin/athdir $HOME` $path .)
110
111endif
112
113# Set appropriate bin directory variable for this platform
114# (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.;  this will
115# be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin):
116set bindir=arch/${ATHENA_SYS}/bin
117
118# *******************  C SHELL SETUP   *******************
119
120# Set up standard C shell initializations
121
122set noclobber                   # Don't overwrite files with redirection
123
124if ($?prompt) then              # For interactive shells only (i.e., NOT rsh):
125  set interactive               #   Provide shell variable for compatability
126endif
127
128# Set up standard C shell aliases
129
130if ($?XSESSION) then
131  alias logout  'exit && gnome-session-save --kill --silent'    # logout for X
132endif
133
134#   aliases dealing with subjects
135alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )'
136alias setup_tty '( setenv SUBJECT \!* ; $SHELL )'
137if ($?XSESSION) then
138  alias setup setup_X
139else
140  alias setup setup_tty
141endif
142alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove ; unsetenv SUBJECT'
143
144# If this is a subject window, run the env_setup script
145if (($?SUBJECT) && (-r $initdir/env_setup)) source $initdir/env_setup
146
147
148# All of the C shell initializing commands above can be overridden by
149# using "unset" or "unalias" commands (or by changing things using
150# "set" or "alias" again) in your ~/.cshrc.mine file, which is sourced
151# here.  ~/.cshrc.mine is not sourced if the xlogin "Ignore your
152# customizations" option was selected to begin the session.
153
154if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) source ~/.cshrc.mine
Note: See TracBrowser for help on using the repository browser.