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