[2054] | 1 | # Prototype file for setting up course-specific environment |
---|
[7861] | 2 | # $Author: cfields $ |
---|
[2054] | 3 | # $Source: /afs/dev.mit.edu/source/repository/packs/dotfiles/env_setup,v $ |
---|
[7861] | 4 | # $Header: /afs/dev.mit.edu/source/repository/packs/dotfiles/env_setup,v 1.5 1995-05-27 20:52:31 cfields Exp $ |
---|
[1434] | 5 | |
---|
[2340] | 6 | # Just in case this alias is not already set, |
---|
[6037] | 7 | alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
| 8 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
| 9 | if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\ |
---|
| 10 | unset extendyes' |
---|
[1434] | 11 | |
---|
[2340] | 12 | echo "Attaching $SUBJECT ... " |
---|
| 13 | set setup_dir = `/bin/athena/attach -p $SUBJECT` |
---|
| 14 | |
---|
[2054] | 15 | if (! $status) then |
---|
[2340] | 16 | |
---|
| 17 | # Record information to remove setup later |
---|
| 18 | set setup_filsys = $SUBJECT |
---|
| 19 | |
---|
| 20 | # Set prompt to reflect changed environment |
---|
[2054] | 21 | set prompt = "$SUBJECT% " |
---|
[2340] | 22 | |
---|
| 23 | if ( -r $setup_dir/.attachrc) then |
---|
| 24 | unsetenv SUBJECT # to prevent infinite loops |
---|
| 25 | echo "Running commands in $setup_dir/.attachrc ... " |
---|
| 26 | source $setup_dir/.attachrc |
---|
[1434] | 27 | else |
---|
[2340] | 28 | # Do minimal environment setup |
---|
[7861] | 29 | extend PATH $setup_dir/${bindir} |
---|
[2340] | 30 | extend MANPATH $setup_dir/man |
---|
[1434] | 31 | endif |
---|
[2054] | 32 | else |
---|
| 33 | echo "" |
---|
| 34 | echo "The $SUBJECT filesystem could not be attached." |
---|
| 35 | set filsys = `hesinfo $SUBJECT filsys` |
---|
| 36 | if ($#filsys < 3) then |
---|
| 37 | echo "Check your spelling of the filesystem name." |
---|
| 38 | else |
---|
[2340] | 39 | echo -n "The $filsys[1] fileserver" |
---|
| 40 | if ($filsys[1] != AFS) echo -n " named $filsys[3]" |
---|
| 41 | echo " may be down." |
---|
[2054] | 42 | endif |
---|
[2340] | 43 | if ($?XSESSION) then |
---|
| 44 | echo "Type exit to get rid of this window." |
---|
| 45 | else |
---|
| 46 | kill -HUP $$ # cause shell to exit |
---|
| 47 | endif |
---|
[2054] | 48 | endif |
---|
[2340] | 49 | unsetenv SUBJECT # to prevent infinite loops |
---|