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

Revision 23030, 5.1 KB checked in by ghudson, 16 years ago (diff)
In dotfiles: * Restore the cdpath and prompt customizations for tcsh. * Eliminate the noclobber and ignoreeof customizations for bash. * Add /sbin and /usr/sbin to the path for both shell types.
  • 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  # 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/athena/clusterinfo ) then
68    setenv PRINTER `awk '/LPR/ { print $3 }' /var/athena/clusterinfo`
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  # Although it's contrary to theory, there is useful stuff in /sbin
87  # and /usr/sbin, and we've traditionally had it in the default path.
88  set path = ( $path /sbin /usr/sbin )
89
90  # Run user environment customizations identified in your
91  # ~/.environment file.  This is the place to include your own
92  # environment variables, attach commands, and other system wide
93  # setup commands.  You can also cancel default behaviors listed
94  # above with "unsetenv" or "setenv".  ~/.environment is not sourced
95  # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your
96  # customizations" option when you logged in).
97
98  if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment
99
100  if ((! $?NOCALLS) && (-r ~/.path)) then
101    # Support .path files for compatibility.
102    set athena_path=$path
103    source ~/.path
104  else
105    # Standard Athena path additions.
106    set path=(`/usr/bin/athdir $HOME` $path .)
107  endif
108
109endif
110
111# Set appropriate bin directory variable for this platform
112# (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.;  this will
113# be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin):
114set bindir=arch/${ATHENA_SYS}/bin
115
116# *******************  C SHELL SETUP   *******************
117
118# Set up standard C shell initializations
119
120set noclobber                   # Don't overwrite files with redirection
121
122if ($?prompt) then              # For interactive shells only (i.e., NOT rsh):
123  # Set prompt.
124  set promptchars="%#"
125  set prompt = "athena%# "
126  set cdpath = (~)
127  set interactive               #   Provide shell variable for compatability
128endif
129
130# Set up standard C shell aliases
131
132#   alias for re-establishing authentication
133alias renew 'kinit -54 $USER && fsid -a && zctl load /dev/null'
134
135#   alias for a convenient way to change terminal type
136alias term 'set noglob; unsetenv TERMCAP; eval `tset -s -I -Q \!*`'
137
138#   aliases dealing with x window system
139alias xresize 'set noglob; eval `resize -c` || unset noglob'
140
141if ($?XSESSION) then
142  if ("$XSESSION" == "") then
143    alias logout        'exit && end_session'           # logout for X
144  else
145    alias logout        'exit && kill -HUP $XSESSION'   # logout for X
146  endif
147endif
148
149#   aliases dealing with subjects
150alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )'
151alias setup_tty '( setenv SUBJECT \!* ; $SHELL )'
152if ($?XSESSION) then
153  alias setup setup_X
154else
155  alias setup setup_tty
156endif
157alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove'
158
159# If this is a subject window, run the env_setup script
160if (($?SUBJECT) && (-r $initdir/env_setup)) source $initdir/env_setup
161
162
163# All of the C shell initializing commands above can be overridden by
164# using "unset" or "unalias" commands (or by changing things using
165# "set" or "alias" again) in your ~/.cshrc.mine file, which is sourced
166# here.  ~/.cshrc.mine is not sourced if the xlogin "Ignore your
167# customizations" option was selected to begin the session.
168
169if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) source ~/.cshrc.mine
Note: See TracBrowser for help on using the repository browser.