[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 | |
---|
[22975] | 54 | # Set double-sided printing for sufficiently recent users. |
---|
| 55 | if ( $ATHENA_DOTFILE_GENERATION >= 1 ) then |
---|
| 56 | setenv LPROPT -Zduplex |
---|
| 57 | endif |
---|
| 58 | |
---|
[22913] | 59 | setenv ATHENA_SYS `/bin/machtype -S` |
---|
[17853] | 60 | if ( $ATHENA_SYS == "" ) then |
---|
| 61 | setenv ATHENA_SYS @sys |
---|
| 62 | endif |
---|
[22913] | 63 | setenv ATHENA_SYS_COMPAT `/bin/machtype -C` |
---|
[17853] | 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 | |
---|
[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 | |
---|
[23049] | 86 | # This "extend" alias and friends have been left in for backwards |
---|
| 87 | # compatibility with old .environment files, just in case. The new |
---|
| 88 | # add alias does not use them. |
---|
| 89 | alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
| 90 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
| 91 | if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\ |
---|
| 92 | unset extendyes' |
---|
| 93 | alias sextend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
| 94 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
| 95 | if ($?extendyes) set \!:1=(${\!:1} \!:2) && \\ |
---|
| 96 | unset extendyes' |
---|
| 97 | alias textend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
| 98 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
| 99 | if ($?extendyes) set \!:1=${\!:1}:\!:2 && \\ |
---|
| 100 | unset extendyes' |
---|
| 101 | |
---|
[17853] | 102 | # Run user environment customizations identified in your |
---|
| 103 | # ~/.environment file. This is the place to include your own |
---|
| 104 | # environment variables, attach commands, and other system wide |
---|
| 105 | # setup commands. You can also cancel default behaviors listed |
---|
| 106 | # above with "unsetenv" or "setenv". ~/.environment is not sourced |
---|
| 107 | # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your |
---|
| 108 | # customizations" option when you logged in). |
---|
| 109 | |
---|
| 110 | if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment |
---|
| 111 | |
---|
[23049] | 112 | unalias extend sextend textend |
---|
| 113 | |
---|
[17853] | 114 | if ((! $?NOCALLS) && (-r ~/.path)) then |
---|
[22940] | 115 | # Support .path files for compatibility. |
---|
| 116 | set athena_path=$path |
---|
[17853] | 117 | source ~/.path |
---|
| 118 | else |
---|
[22940] | 119 | # Standard Athena path additions. |
---|
[22925] | 120 | set path=(`/usr/bin/athdir $HOME` $path .) |
---|
[17853] | 121 | endif |
---|
| 122 | |
---|
| 123 | endif |
---|
| 124 | |
---|
| 125 | # Set appropriate bin directory variable for this platform |
---|
| 126 | # (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.; this will |
---|
| 127 | # be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin): |
---|
| 128 | set bindir=arch/${ATHENA_SYS}/bin |
---|
| 129 | |
---|
| 130 | # ******************* C SHELL SETUP ******************* |
---|
| 131 | |
---|
| 132 | # Set up standard C shell initializations |
---|
| 133 | |
---|
| 134 | set noclobber # Don't overwrite files with redirection |
---|
| 135 | |
---|
| 136 | if ($?prompt) then # For interactive shells only (i.e., NOT rsh): |
---|
| 137 | # Set prompt. |
---|
| 138 | set promptchars="%#" |
---|
[23030] | 139 | set prompt = "athena%# " |
---|
| 140 | set cdpath = (~) |
---|
[17853] | 141 | set interactive # Provide shell variable for compatability |
---|
| 142 | endif |
---|
| 143 | |
---|
| 144 | # Set up standard C shell aliases |
---|
| 145 | |
---|
| 146 | # alias for re-establishing authentication |
---|
[22913] | 147 | alias renew 'kinit -54 $USER && fsid -a && zctl load /dev/null' |
---|
[17853] | 148 | |
---|
| 149 | # alias for a convenient way to change terminal type |
---|
| 150 | alias term 'set noglob; unsetenv TERMCAP; eval `tset -s -I -Q \!*`' |
---|
| 151 | |
---|
| 152 | # aliases dealing with x window system |
---|
| 153 | alias xresize 'set noglob; eval `resize -c` || unset noglob' |
---|
| 154 | |
---|
| 155 | if ($?XSESSION) then |
---|
| 156 | if ("$XSESSION" == "") then |
---|
| 157 | alias logout 'exit && end_session' # logout for X |
---|
| 158 | else |
---|
| 159 | alias logout 'exit && kill -HUP $XSESSION' # logout for X |
---|
| 160 | endif |
---|
| 161 | endif |
---|
| 162 | |
---|
| 163 | # aliases dealing with subjects |
---|
| 164 | alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )' |
---|
| 165 | alias setup_tty '( setenv SUBJECT \!* ; $SHELL )' |
---|
| 166 | if ($?XSESSION) then |
---|
| 167 | alias setup setup_X |
---|
| 168 | else |
---|
| 169 | alias setup setup_tty |
---|
| 170 | endif |
---|
| 171 | alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove' |
---|
| 172 | |
---|
| 173 | # If this is a subject window, run the env_setup script |
---|
| 174 | if (($?SUBJECT) && (-r $initdir/env_setup)) source $initdir/env_setup |
---|
| 175 | |
---|
| 176 | |
---|
| 177 | # All of the C shell initializing commands above can be overridden by |
---|
| 178 | # using "unset" or "unalias" commands (or by changing things using |
---|
| 179 | # "set" or "alias" again) in your ~/.cshrc.mine file, which is sourced |
---|
| 180 | # here. ~/.cshrc.mine is not sourced if the xlogin "Ignore your |
---|
| 181 | # customizations" option was selected to begin the session. |
---|
| 182 | |
---|
| 183 | if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) source ~/.cshrc.mine |
---|