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