[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 |
---|
[22940] | 32 | # environment variables, attachment of lockers, and additions to search path) |
---|
[17853] | 33 | |
---|
| 34 | if (! $?ENV_SET) then |
---|
| 35 | |
---|
| 36 | setenv ENV_SET # Avoid unnecessary repeat |
---|
| 37 | |
---|
[22975] | 38 | if (-r ~/.generation) then |
---|
| 39 | setenv ATHENA_DOTFILE_GENERATION `cat ~/.generation` |
---|
| 40 | else |
---|
| 41 | setenv ATHENA_DOTFILE_GENERATION 0 |
---|
| 42 | endif |
---|
| 43 | |
---|
[17853] | 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 | |
---|
[23438] | 54 | setenv EMAIL "$USER@mit.edu" # Set default email address |
---|
| 55 | |
---|
[22975] | 56 | # Set double-sided printing for sufficiently recent users. |
---|
| 57 | if ( $ATHENA_DOTFILE_GENERATION >= 1 ) then |
---|
| 58 | setenv LPROPT -Zduplex |
---|
| 59 | endif |
---|
| 60 | |
---|
[22913] | 61 | setenv ATHENA_SYS `/bin/machtype -S` |
---|
[17853] | 62 | if ( $ATHENA_SYS == "" ) then |
---|
| 63 | setenv ATHENA_SYS @sys |
---|
| 64 | endif |
---|
[22913] | 65 | setenv ATHENA_SYS_COMPAT `/bin/machtype -C` |
---|
[17853] | 66 | |
---|
| 67 | set bindir=arch/${ATHENA_SYS}/bin |
---|
| 68 | |
---|
[23132] | 69 | if ( ! $?PRINTER && -e /var/run/athena-clusterinfo.csh ) then |
---|
| 70 | setenv PRINTER `awk '/LPR/ { print $3 }' /var/run/athena-clusterinfo.csh` |
---|
[17853] | 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 | |
---|
[22667] | 79 | set x=`(cd && /bin/pwd)` |
---|
[17853] | 80 | if ("$x" != "") then |
---|
[22667] | 81 | set home=$x |
---|
| 82 | if ("$x" == "`/bin/pwd`") then |
---|
| 83 | set cwd=$x |
---|
| 84 | endif |
---|
[17853] | 85 | endif |
---|
| 86 | unset x |
---|
| 87 | |
---|
[23049] | 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 | |
---|
[17853] | 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 | |
---|
[23049] | 114 | unalias extend sextend textend |
---|
| 115 | |
---|
[17853] | 116 | if ((! $?NOCALLS) && (-r ~/.path)) then |
---|
[22940] | 117 | # Support .path files for compatibility. |
---|
[23180] | 118 | set athena_path=($path) |
---|
[17853] | 119 | source ~/.path |
---|
| 120 | else |
---|
[22940] | 121 | # Standard Athena path additions. |
---|
[22925] | 122 | set path=(`/usr/bin/athdir $HOME` $path .) |
---|
[17853] | 123 | endif |
---|
| 124 | |
---|
| 125 | endif |
---|
| 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): |
---|
| 130 | set bindir=arch/${ATHENA_SYS}/bin |
---|
| 131 | |
---|
| 132 | # ******************* C SHELL SETUP ******************* |
---|
| 133 | |
---|
| 134 | # Set up standard C shell initializations |
---|
| 135 | |
---|
| 136 | set noclobber # Don't overwrite files with redirection |
---|
| 137 | |
---|
| 138 | if ($?prompt) then # For interactive shells only (i.e., NOT rsh): |
---|
| 139 | # Set prompt. |
---|
| 140 | set promptchars="%#" |
---|
[23030] | 141 | set prompt = "athena%# " |
---|
| 142 | set cdpath = (~) |
---|
[17853] | 143 | set interactive # Provide shell variable for compatability |
---|
| 144 | endif |
---|
| 145 | |
---|
| 146 | # Set up standard C shell aliases |
---|
| 147 | |
---|
| 148 | # alias for re-establishing authentication |
---|
[22913] | 149 | alias renew 'kinit -54 $USER && fsid -a && zctl load /dev/null' |
---|
[17853] | 150 | |
---|
| 151 | # alias for a convenient way to change terminal type |
---|
| 152 | alias term 'set noglob; unsetenv TERMCAP; eval `tset -s -I -Q \!*`' |
---|
| 153 | |
---|
| 154 | # aliases dealing with x window system |
---|
| 155 | alias xresize 'set noglob; eval `resize -c` || unset noglob' |
---|
| 156 | |
---|
| 157 | if ($?XSESSION) then |
---|
[23182] | 158 | alias logout 'exit && gnome-session-save --kill --silent' # logout for X |
---|
[17853] | 159 | endif |
---|
| 160 | |
---|
| 161 | # aliases dealing with subjects |
---|
| 162 | alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )' |
---|
| 163 | alias setup_tty '( setenv SUBJECT \!* ; $SHELL )' |
---|
| 164 | if ($?XSESSION) then |
---|
| 165 | alias setup setup_X |
---|
| 166 | else |
---|
| 167 | alias setup setup_tty |
---|
| 168 | endif |
---|
| 169 | alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove' |
---|
| 170 | |
---|
| 171 | # If this is a subject window, run the env_setup script |
---|
| 172 | if (($?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 | |
---|
| 181 | if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) source ~/.cshrc.mine |
---|